summaryrefslogtreecommitdiff
path: root/examples/nodestats.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/nodestats.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/nodestats.py')
-rwxr-xr-xexamples/nodestats.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/nodestats.py b/examples/nodestats.py
index 88ca462..10520b2 100755
--- a/examples/nodestats.py
+++ b/examples/nodestats.py
@@ -5,7 +5,6 @@
# Michal Privoznik <mprivozn@redhat.com>
import libvirt
-import sys
from xml.dom import minidom
import libxml2
from typing import Any, Dict # noqa F401
@@ -22,13 +21,13 @@ try:
conn = libvirt.openReadOnly(None)
except libvirt.libvirtError:
print("Failed to connect to the hypervisor")
- sys.exit(1)
+ exit(1)
try:
capsXML = conn.getCapabilities()
except libvirt.libvirtError:
print("Failed to request capabilities")
- sys.exit(1)
+ exit(1)
caps = minidom.parseString(capsXML)
cells = caps.getElementsByTagName("cells")[0]