Shutdown Source VM (PAUSED) on successfull migration + blackened all .py files
This commit is contained in:
parent
29e938dc74
commit
9bdf4d2180
31 changed files with 1307 additions and 638 deletions
|
|
@ -20,12 +20,16 @@ class Field:
|
|||
|
||||
def is_valid(self):
|
||||
if self.value == KeyError:
|
||||
self.add_error("'{}' field is a required field".format(self.name))
|
||||
self.add_error(
|
||||
"'{}' field is a required field".format(self.name)
|
||||
)
|
||||
else:
|
||||
if isinstance(self.value, Optional):
|
||||
pass
|
||||
elif not isinstance(self.value, self.type):
|
||||
self.add_error("Incorrect Type for '{}' field".format(self.name))
|
||||
self.add_error(
|
||||
"Incorrect Type for '{}' field".format(self.name)
|
||||
)
|
||||
else:
|
||||
self.validation()
|
||||
|
||||
|
|
@ -49,6 +53,10 @@ class VmUUIDField(Field):
|
|||
self.validation = self.vm_uuid_validation
|
||||
|
||||
def vm_uuid_validation(self):
|
||||
r = shared.etcd_client.get(os.path.join(settings['etcd']['vm_prefix'], self.uuid))
|
||||
r = shared.etcd_client.get(
|
||||
os.path.join(settings["etcd"]["vm_prefix"], self.uuid)
|
||||
)
|
||||
if not r:
|
||||
self.add_error("VM with uuid {} does not exists".format(self.uuid))
|
||||
self.add_error(
|
||||
"VM with uuid {} does not exists".format(self.uuid)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue