1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-20 12:59:21 +03:00

examples: Replace sys.exit() with exit()

No need to import sys.

Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
Philipp Hahn
2020-07-28 07:15:55 +02:00
committed by Philipp Hahn
parent f496dc55ee
commit b801ff31fa
10 changed files with 18 additions and 28 deletions

View File

@ -5,7 +5,6 @@ If the domain is not running, create it.
"""
import libvirt
import sys
import libxml2
from argparse import ArgumentParser
from typing import Tuple
@ -33,7 +32,7 @@ try:
conn = libvirt.open(None)
except libvirt.libvirtError:
print('Failed to open connection to the hypervisor')
sys.exit(1)
exit(1)
try:
dom = conn.lookupByName(name)
@ -42,6 +41,6 @@ except libvirt.libvirtError:
dom = conn.createLinux(xmldesc, 0)
if dom is None:
print("failed")
sys.exit(1)
exit(1)
else:
print("done")