add check vm

master
Долгий Артём 2023-03-11 22:37:45 +03:00
parent e171887466
commit 69d86eb9b9
2 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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)