From 231f9619459d22300ec468d5fb5039feae84d60a Mon Sep 17 00:00:00 2001 From: wangyong <864072399@qq.com> Date: Wed, 23 Mar 2016 11:56:32 +0800 Subject: [PATCH] fix asset upload bug --- jasset/asset_api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jasset/asset_api.py b/jasset/asset_api.py index bf0d77196..20fb41118 100644 --- a/jasset/asset_api.py +++ b/jasset/asset_api.py @@ -290,6 +290,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: