This commit is contained in:
Vyacheslav Anzhiganov 2016-06-24 03:09:06 +03:00
parent f83e889d22
commit 1daf5d1298
2 changed files with 6 additions and 4 deletions

View file

@ -9,9 +9,11 @@ class ControllerIps:
def getfree(self, datacenter_id):
# select IP
return models.Ips.select().where(
models.Ips.datacenter == datacenter_id and models.Ips.status == 0
).get()
return models.Ips.select().join(models.Servers).where(
models.Ips.datacenter == datacenter_id,
models.Servers.status == 1,
models.Ips.status == 0
).first()
def setbusy(self, ip_id):
# mark ip as busy (taken)

View file

@ -4,7 +4,7 @@ from setuptools import setup
setup(
name='SWSCloudCore',
version='2.5.8',
version='2.5.9',
author='Vyacheslav Anzhiganov',
author_email='hello@anzhiganov.com',
packages=[