add check vm
This commit is contained in:
@@ -18,8 +18,8 @@ def check_vm(id):
|
||||
:return: None
|
||||
"""
|
||||
proc = subprocess.run(f'qm status {id}'.split(), capture_output=True, text=True)
|
||||
if proc.stderr:
|
||||
print(f'Вероятно ВМ с идентификатором - {id} существует')
|
||||
if not proc.stderr:
|
||||
print(f'Вероятно ВМ с идентификатором - {id} уже существует')
|
||||
print(proc.stderr)
|
||||
exit(1)
|
||||
|
||||
|
||||
@@ -87,8 +87,8 @@ def deploy_template(list_commands):
|
||||
|
||||
def check_vm(id):
|
||||
proc = subprocess.run(f'qm status {id}'.split(), capture_output=True, text=True)
|
||||
if proc.stderr:
|
||||
print(f'Вероятно ВМ с идентификатором - {id} существует')
|
||||
if not proc.stderr:
|
||||
print(f'Вероятно ВМ с идентификатором - {id} уже существует')
|
||||
print(proc.stderr)
|
||||
exit(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user