[api] config updates and add default values
This commit is contained in:
parent
a4bedb01f6
commit
cdbfb96e71
3 changed files with 21 additions and 16 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import os
|
||||
|
||||
from ucloud.config import etcd_client, env_vars
|
||||
|
||||
from ucloud.config import etcd_client, config
|
||||
|
||||
class Optional:
|
||||
pass
|
||||
|
|
@ -48,6 +47,6 @@ class VmUUIDField(Field):
|
|||
self.validation = self.vm_uuid_validation
|
||||
|
||||
def vm_uuid_validation(self):
|
||||
r = etcd_client.get(os.path.join(env_vars.get('VM_PREFIX'), self.uuid))
|
||||
r = etcd_client.get(os.path.join(config['api']['VM_PREFIX'], self.uuid))
|
||||
if not r:
|
||||
self.add_error("VM with uuid {} does not exists".format(self.uuid))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue