Commit c39623d7 authored by Jeff MrBE4R's avatar Jeff MrBE4R
Browse files

second commit

parent 6d4e29b5
......@@ -361,13 +361,16 @@ def admin_vm():
elif request.form['action'] == str('token.cfg').decode('utf8)'):
### Backup token file
fobj_in = open('/opt/noVNC/token.cfg')
#fobj_in = open('./token.cfg')
fobj_out = open('/opt/noVNC/token.cfg.bkp', "w")
#fobj_out = open('./token.cfg.bkp', "w")
fobj_out.truncate()
for line in fobj_in:
fobj_out.write(line)
fobj_in.close()
fobj_out.close()
fobj_out = open('/opt/noVNC/token.cfg', 'w')
#fobj_out = open('./token.cfg', 'w')
res = config.Config.conn.execute(
select(
[
......@@ -379,7 +382,7 @@ def admin_vm():
)
)
for row in res:
fobj_out.write(str(str(row['vm_uuid']) + ': ' + str(row['address']) + ':5901\n'))
fobj_out.write(str(str(row['token']) + ': ' + str(row['ip']) + ':5901\n'))
return 'a'
return redirect(url_for('admin_vm'))
elif request.method == 'GET':
......
Supports Markdown
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