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):
|
||||
# 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)
|
||||
|
|
Loading…
Add table
Reference in a new issue