fix asset upload bug

pull/26/head
ibuler 2015-12-14 16:26:12 +08:00
parent a8bdc37780
commit 5e5aab7962
2 changed files with 2 additions and 2 deletions

View File

@ -130,7 +130,7 @@ def gen_ssh_key(username, password='',
"""
logger.debug('生成ssh key 并设置authorized_keys')
private_key_file = os.path.join(key_dir, username+'.pem')
mkdir(key_dir, mode=0700)
mkdir(key_dir, mode=0777)
if os.path.isfile(private_key_file):
os.unlink(private_key_file)
ret = bash('echo -e "y\n"|ssh-keygen -t rsa -f %s -b %s -P "%s"' % (private_key_file, length, password))

View File

@ -44,7 +44,7 @@
<div class="alert alert-success text-center">{{ smg }}</div>
{% endif %}
<p>请下载Excel文件, 按照格式填写主机信息, 上传导入. <a href="/static/files/excels/asset.xlsx">点击下载模板</a></p>
<form action="/jasset/upload/" method="POST" enctype="multipart/form-data">
<form action="{% url 'asset_upload' %}" method="POST" enctype="multipart/form-data">
<div class="file-box">
<input id='textfield' />
<input type="button" class="btn btn-info btn-sm" name="file_name" value="点击选择文件">