Commit 267c1cd6 authored by ibuler's avatar ibuler

Merge pull request #142 from jumpserver/bug_asset_upload

fix asset upload bug
parents 4dbc6803 a1e947ae
...@@ -288,6 +288,8 @@ def excel_to_db(excel_file): ...@@ -288,6 +288,8 @@ def excel_to_db(excel_file):
ip, port, hostname, use_default_auth, username, password, group = row ip, port, hostname, use_default_auth, username, password, group = row
if get_object(Asset, hostname=hostname): if get_object(Asset, hostname=hostname):
continue continue
if isinstance(password, int) or isinstance(password, float):
password = unicode(int(password))
use_default_auth = 1 if use_default_auth == u'默认' else 0 use_default_auth = 1 if use_default_auth == u'默认' else 0
password_encode = CRYPTOR.encrypt(password) if password else '' password_encode = CRYPTOR.encrypt(password) if password else ''
if hostname: if hostname:
...@@ -311,7 +313,6 @@ def excel_to_db(excel_file): ...@@ -311,7 +313,6 @@ def excel_to_db(excel_file):
def get_ansible_asset_info(asset_ip, setup_info): def get_ansible_asset_info(asset_ip, setup_info):
print setup_info, '***'
disk_need = {} disk_need = {}
disk_all = setup_info.get("ansible_devices") disk_all = setup_info.get("ansible_devices")
if disk_all: if disk_all:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment