From e1e2c72a7cf725c9de225a90e0cbe689df85b623 Mon Sep 17 00:00:00 2001 From: deflax Date: Mon, 31 Jul 2017 02:15:40 +0300 Subject: [PATCH] vmcreate function phase 2 --- grid.py | 2 +- plugin.py | 5 +---- proxmaster.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/grid.py b/grid.py index a5f1dba..911eb94 100644 --- a/grid.py +++ b/grid.py @@ -23,7 +23,7 @@ def queryvm(req_cube_id): """ returns slave_name, vm_id and vm_type for the requested cubeid """ data = querydb(req_cube_id) #print(data) - return data['slave'], data['type'], data['vmid'], data['host'], data['clientemail'] + return data['slave'], data['type'], data['vmid'], data['hostname'], data['clientemail'] def querydb(cubeid): diff --git a/plugin.py b/plugin.py index fea5361..feed6de 100644 --- a/plugin.py +++ b/plugin.py @@ -83,8 +83,6 @@ def vmcreate(req): } proxobject = auth(slave_name) real_slave_name = proxobject.cluster.status.get()[0]['name'] - #print(real_slave_name) - description = vm_name + ' (' + str(cubeid) + '/' + str(vm_id) + ')\n' + 'owned by ' + req['clientname'] + ' (' + req['clientid'] + ')\n' if req['vps_type'] == 'kvm': @@ -124,12 +122,11 @@ def vmcreate(req): print(str(create_result)) - #TODO: setup based on req['vps_recipe'] #start the machihe #time.sleep(7) #wait few seconds for the slave to prepare the machine for initial run #vmstart(cubeid) - response = { 'status':'CREATE', 'cube':cubeid, 'name':vm_name, 'password':vm_pass } + response = { 'status': 'CREATE', 'cube': cubeid, 'hostname': vm_name, 'password': vm_pass, 'slave': real_slave_name } grid.writedb(deploy) return response diff --git a/proxmaster.py b/proxmaster.py index 1068431..a982712 100644 --- a/proxmaster.py +++ b/proxmaster.py @@ -20,7 +20,7 @@ logger = ioconfig.logger def welcome(): """displays motd in log as welcome message""" - logger.info('# proxmaster ][ (c) 2015-2016 afx #') + logger.info('# proxmaster ][ (c) 2015-2017 deflax.net #') def selector(fn, req, vmid=0):