修改推送默认端口bug

pull/47/head
ibuler 2016-01-21 18:17:18 +08:00
parent 36bfb50aad
commit 1c2cba64ec
1 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,6 @@ def get_asset_info(asset):
info = {'hostname': asset.hostname, 'ip': asset.ip} info = {'hostname': asset.hostname, 'ip': asset.ip}
if asset.use_default_auth: if asset.use_default_auth:
if default: if default:
info['port'] = int(default.field2)
info['username'] = default.field1 info['username'] = default.field1
try: try:
info['password'] = CRYPTOR.decrypt(default.field3) info['password'] = CRYPTOR.decrypt(default.field3)
@ -73,10 +72,11 @@ def get_asset_info(asset):
if os.path.isfile(default.field4): if os.path.isfile(default.field4):
info['ssh_key'] = default.field4 info['ssh_key'] = default.field4
else: else:
info['port'] = int(asset.port)
info['username'] = asset.username info['username'] = asset.username
info['password'] = CRYPTOR.decrypt(asset.password) info['password'] = CRYPTOR.decrypt(asset.password)
info['port'] = int(asset.port)
return info return info