Handle vm_id is None case

This commit is contained in:
PCoder 2020-12-10 08:40:40 +05:30
parent 890a83cfa6
commit 785091e4ff
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ class Command(BaseCommand):
ssh_key='\n'.join(pub_keys),
vm_name=vm_name
)
if vm_id > 0:
if vm_id and vm_id > 0:
result_dict[vm_name] = "%s OK, created VM %s" % (
'%s %s' % (vm_template.opennebula_vm_template_id,
vm_template.name),