Commit 9a9a9b06 by Sulyok Gábor

Controller and model fix

parent 252d3595
......@@ -112,23 +112,21 @@ class SettyController:
else:
raise PermissionDenied # TODO: something more meaningful
@staticmethod
def getMachineAvailableList(serviceId, used_hostnames, current_user):
all_minions = SettyController.salthelper.getAllMinionsUngrouped()
usedMachines = Machine.objects.get(service=serviceId)
user_instances = Instance.objects.get(owner=current_user)
all_minions = []# SettyController.salthelper.getAllMinionsUngrouped()
usedMachines = Machine.objects.filter(service=serviceId)
user_instances = Instance.objects.filter(owner=current_user)
userMachines = []
userMachines = []
for instance in user_instances:
if user_instances.vm_name():
userMachines.append(user_instances.vm_name())
result = []
for machine in usedMachines:
if machine.hostname not in userMachines:
result.append(machine.hostname)
if instance.vm_name:
print instance.vm_name
userMachines.append(instance.vm_name)
return {'machinedata': result}
return {'machinedata': userMachines}
@staticmethod
def addMachine(hostname):
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('setty', '0024_AddApacheAndWordpress'),
]
operations = [
migrations.CreateModel(
name='DatabaseNode',
fields=[
('servicenode_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='setty.ServiceNode')),
('adminUserName', models.CharField(max_length=50)),
('adminPassword', models.CharField(max_length=50)),
('listeningPort', models.PositiveIntegerField()),
],
options={
'abstract': False,
},
bases=('setty.servicenode',),
),
migrations.CreateModel(
name='MySQLNode',
fields=[
('databasenode_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='setty.DatabaseNode')),
],
options={
'abstract': False,
},
bases=('setty.databasenode',),
),
migrations.CreateModel(
name='PostgreSQLNode',
fields=[
('databasenode_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='setty.DatabaseNode')),
],
options={
'abstract': False,
},
bases=('setty.databasenode',),
),
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment