Disconnect if connected when trying to connect

This commit is contained in:
Bridget
2020-04-13 12:11:38 +02:00
parent 08b858e12f
commit 8ee1868616

View File

@@ -56,6 +56,9 @@ class Shell(cmd.Cmd):
def do_connect(self, url):
"""Connect to given URL."""
if self.url:
self.do_disconnect(None)
try:
result = self.send_cmd(url, "init")
except requests.exceptions.InvalidURL: