Merge branch 'master' of 10.10.10.10:sws/swscloudcore
This commit is contained in:
commit
3bda766bf6
1 changed files with 5 additions and 3 deletions
|
@ -9,9 +9,11 @@ class ControllerIps:
|
||||||
|
|
||||||
def getfree(self, datacenter_id):
|
def getfree(self, datacenter_id):
|
||||||
# select IP
|
# select IP
|
||||||
return models.Ips.select().where(
|
return models.Ips.select().join(models.Servers).where(
|
||||||
models.Ips.datacenter == datacenter_id and models.Ips.status == 0
|
models.Ips.datacenter == datacenter_id,
|
||||||
).get()
|
models.Servers.status == 1,
|
||||||
|
models.Ips.status == 0
|
||||||
|
).first()
|
||||||
|
|
||||||
def setbusy(self, ip_id):
|
def setbusy(self, ip_id):
|
||||||
# mark ip as busy (taken)
|
# mark ip as busy (taken)
|
||||||
|
|
Loading…
Add table
Reference in a new issue