Handle case where no auth configuration in /etc
Change-Id: I7bd07cbc9cbf819d5bdfa9abc3dff666dc0d8046
This commit is contained in:
parent
d0f40b1445
commit
6395225a49
@ -98,14 +98,17 @@ class AgentConnection():
|
||||
auth["username"] = None
|
||||
auth["password"] = None
|
||||
|
||||
conf = self._swconfig.getByIP(self.host)
|
||||
if conf:
|
||||
if "username" in conf:
|
||||
auth["username"] = conf["username"]
|
||||
if "password" in conf:
|
||||
auth["password"] = conf["password"]
|
||||
if "auth" in conf:
|
||||
auth["auth"] = conf["auth"]
|
||||
try:
|
||||
conf = self._swconfig.getByIP(self.host)
|
||||
if conf:
|
||||
if "username" in conf:
|
||||
auth["username"] = conf["username"]
|
||||
if "password" in conf:
|
||||
auth["password"] = conf["password"]
|
||||
if "auth" in conf:
|
||||
auth["auth"] = conf["auth"]
|
||||
except:
|
||||
pass
|
||||
|
||||
if auth["auth"] == None:
|
||||
auth["auth"] = os.getenv("BV_AUTH")
|
||||
|
Loading…
x
Reference in New Issue
Block a user