From a1e947ae1e01d038d4f4c413d095f0d7683991f5 Mon Sep 17 00:00:00 2001 From: wangyong <864072399@qq.com> Date: Tue, 22 Mar 2016 17:32:43 +0800 Subject: [PATCH] fix asset upload bug --- jasset/asset_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jasset/asset_api.py b/jasset/asset_api.py index 7cc49fa66..ac3a908a6 100644 --- a/jasset/asset_api.py +++ b/jasset/asset_api.py @@ -288,6 +288,8 @@ def excel_to_db(excel_file): ip, port, hostname, use_default_auth, username, password, group = row if get_object(Asset, hostname=hostname): continue + if isinstance(password, int) or isinstance(password, float): + password = unicode(int(password)) use_default_auth = 1 if use_default_auth == u'默认' else 0 password_encode = CRYPTOR.encrypt(password) if password else '' if hostname: @@ -311,7 +313,6 @@ def excel_to_db(excel_file): def get_ansible_asset_info(asset_ip, setup_info): - print setup_info, '***' disk_need = {} disk_all = setup_info.get("ansible_devices") if disk_all: