Handle case where no auth configuration in /etc

Change-Id: I7bd07cbc9cbf819d5bdfa9abc3dff666dc0d8046
This commit is contained in:
Vitaliy Kharechko 2016-08-01 10:25:35 +03:00
parent d0f40b1445
commit 6395225a49

View File

@ -98,6 +98,7 @@ class AgentConnection():
auth["username"] = None
auth["password"] = None
try:
conf = self._swconfig.getByIP(self.host)
if conf:
if "username" in conf:
@ -106,6 +107,8 @@ class AgentConnection():
auth["password"] = conf["password"]
if "auth" in conf:
auth["auth"] = conf["auth"]
except:
pass
if auth["auth"] == None:
auth["auth"] = os.getenv("BV_AUTH")