selected slave on post

This commit is contained in:
deflax 2018-04-02 16:12:30 +03:00
parent 00e0848d26
commit 0267be256f

View file

@ -74,10 +74,13 @@ def vmcreate(orderid):
form = SlaveForm() form = SlaveForm()
if form.validate_on_submit(): if form.validate_on_submit():
selectedslaveswitch = form.slaveswitcher.data
selectedslave = Server.query.filter_by(pid=int(selectedslaveswitch)).first()
data = { 'clientid': str(order.user_id), data = { 'clientid': str(order.user_id),
'clientemail': str(order.owner.email), 'clientemail': str(order.owner.email),
'hostname': 'c' + str(order.user_id) + '-' + str(order.parameter1), 'hostname': 'c' + str(order.user_id) + '-' + str(order.parameter1),
'region': str(order.region.name), 'region': str(order.region.name),
'slave': str(selectedslave.name),
'type': 'kvm', 'type': 'kvm',
'cpu': str(int(order.parameter2)), 'cpu': str(int(order.parameter2)),
'mem': str(int(order.parameter3)), 'mem': str(int(order.parameter3)),