Fix incorrect check on presence of password and pub_key (#2355)
This commit fixes an issue with the use of None in default values for the config get() calls in __init__() of AsusWrtDeviceScanner. These values are cast as strings and when a NoneType is cast it returns the string "None" this broke the check for the existence of these fields. This commit fixes the issue by changing the default value to be an empty string '' which will conform with the behavior expected by the ssh login code. Closes #2343
This commit is contained in:
1 parent
7b942243ab
commit
aa3d0e1047
2 files changed
+67
-2
No files matched your search
@@ -83,8 +83,8 @@ class AsusWrtDeviceScanner(object):
|
||||
"""Initialize the scanner."""
|
||||
self.host = config[CONF_HOST]
|
||||
self.username = str(config[CONF_USERNAME])
|
||||
self.password = str(config.get(CONF_PASSWORD))
|
||||
self.pub_key = str(config.get('pub_key'))
|
||||
self.password = str(config.get(CONF_PASSWORD, ""))
|
||||
self.pub_key = str(config.get('pub_key', ""))
|
||||
self.protocol = config.get('protocol')
|
||||
self.mode = config.get('mode')
|
||||
|
||||
|
||||
Reference in new issue
Block a user