diff --git a/clientsdb.py b/clientsdb.py index 6fb11c6..4e3cf73 100644 --- a/clientsdb.py +++ b/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 diff --git a/grid.py b/grid.py index e4e9ea6..6d65e9c 100644 --- a/grid.py +++ b/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