some bugs squashed
This commit is contained in:
parent
1f405f7990
commit
24eb11bef3
2 changed files with 5 additions and 8 deletions
11
clientsdb.py
11
clientsdb.py
|
@ -27,7 +27,7 @@ def addclient(vmid, vmname, clientid, clientname, clientemail, vmpass):
|
|||
vcard = { 'name':str(clientname), 'email':str(clientemail), 'encpasswd':str(encpasswd) }
|
||||
newclient = { str(clientid):vcard }
|
||||
clientsdb.update(newclient)
|
||||
#TODO: 1. Send initial email to the user as we wont use the internal auth from now on.
|
||||
#TODO: 1. Send initial email to the user as we will use the internal auth from now on.
|
||||
#TODO: 2. Sync with proxmaster-admin database (shell command could be used for this one)
|
||||
ioconfig.logger.info('client[{}]> vmid {} is now owned by {} ({})'.format(clientemail, vmid, clientid, clientname))
|
||||
|
||||
|
@ -45,12 +45,11 @@ def setencpasswd(clientemail, newpass):
|
|||
|
||||
try:
|
||||
clientsdb = readclientsdb()
|
||||
#print(clientsdb)
|
||||
path = utils.get_path(clientsdb, clientemail)
|
||||
#print(path)
|
||||
c_id = str(path[0])
|
||||
#check the returned path with forward query
|
||||
query = clientsdb[c_id]['email']
|
||||
ioconfig.logger.info('client[{}]> found. path={}'.format(clientemail, str(path)))
|
||||
except:
|
||||
raise
|
||||
|
||||
|
@ -59,7 +58,7 @@ def setencpasswd(clientemail, newpass):
|
|||
raise
|
||||
else:
|
||||
clientsdb[c_id]['encpasswd'] = encpasswd
|
||||
ioconfig.logger.info('client[{}]> got its management password changed!'.format(clientemail))
|
||||
ioconfig.logger.info('client[{}]> password changed!'.format(clientemail))
|
||||
writeclientsdb(clientsdb)
|
||||
#TODO: Send new email to the client to notify the password change. This time sending the password in plain text is not needed.
|
||||
|
||||
|
@ -106,9 +105,7 @@ def clientvms(vmlist):
|
|||
|
||||
response = []
|
||||
for vmid,data in vmlist.items():
|
||||
print(vmid)
|
||||
print(data)
|
||||
response = { 'vmid':vmid }
|
||||
response = { str(vmid):data }
|
||||
return response
|
||||
|
||||
|
||||
|
|
2
grid.py
2
grid.py
|
@ -342,7 +342,7 @@ def query_vm(req_vmid):
|
|||
logger.error('vm[{}]> type is unknown!'.format(vm_id))
|
||||
raise
|
||||
|
||||
logger.info('vm[{}]> type {} found. path=region={} found.'.format(target, vm_type, str(path)))
|
||||
logger.info('vm[{}]> type {} found. path={} '.format(target, vm_type, str(path)))
|
||||
|
||||
return slave_id, vm_type
|
||||
|
||||
|
|
Loading…
Reference in a new issue