summaryrefslogtreecommitdiff
path: root/examples/guest-vcpus/guest-vcpu.py
diff options
context:
space:
mode:
authorPhilipp Hahn <hahn@univention.de>2020-07-28 07:15:55 +0200
committerPhilipp Hahn <pmhahn+github@pmhahn.de>2020-08-05 07:43:02 +0000
commitb801ff31faf97a616e554ba266783d480e00b781 (patch)
treeff56f75ee3368b2f9edc36a5dc002295d38ece8a /examples/guest-vcpus/guest-vcpu.py
parentf496dc55ee0c4ec248e27fd78f04edc51e75a92f (diff)
downloadlibvirt-python-b801ff31faf97a616e554ba266783d480e00b781.tar.gz
examples: Replace sys.exit() with exit()
No need to import sys. Signed-off-by: Philipp Hahn <hahn@univention.de>
Diffstat (limited to 'examples/guest-vcpus/guest-vcpu.py')
-rwxr-xr-xexamples/guest-vcpus/guest-vcpu.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/guest-vcpus/guest-vcpu.py b/examples/guest-vcpus/guest-vcpu.py
index 68bb5bf..a0a4f05 100755
--- a/examples/guest-vcpus/guest-vcpu.py
+++ b/examples/guest-vcpus/guest-vcpu.py
@@ -5,7 +5,6 @@ used by guest-vcpu-daemon.py example
"""
import libvirt
-import sys
from argparse import ArgumentParser
customXMLuri = "guest-cpu.python.libvirt.org"
@@ -28,14 +27,14 @@ if flags == 0 or args.config:
if confvcpus < args.count:
print("Persistent domain configuration has only " + str(confvcpus) + " vcpus configured")
- sys.exit(1)
+ exit(1)
if flags == 0 or args.live:
livevcpus = dom.vcpusFlags(libvirt.VIR_DOMAIN_AFFECT_LIVE)
if livevcpus < args.count:
print("Live domain configuration has only " + str(livevcpus) + " vcpus configured")
- sys.exit(1)
+ exit(1)
if flags == 0 or args.live:
dom.setVcpusFlags(args.count, libvirt.VIR_DOMAIN_AFFECT_LIVE | libvirt.VIR_DOMAIN_VCPU_GUEST)