summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/examples/create_disk.py5
-rw-r--r--python/t/010-basic.py1
2 files changed, 6 insertions, 0 deletions
diff --git a/python/examples/create_disk.py b/python/examples/create_disk.py
index 0885383e..86f50427 100644
--- a/python/examples/create_disk.py
+++ b/python/examples/create_disk.py
@@ -51,6 +51,11 @@ g.mkdir ("/foo")
# the disk image.
g.upload ("/etc/resolv.conf", "/foo/resolv.conf")
+# Because we wrote to the disk and we want to detect write
+# errors, call g.shutdown. You don't need to do this:
+# g.close will do it implicitly.
+g.shutdown ()
+
# Note also that handles are automatically closed if they are
# reaped by reference counting. You only need to call close
# if you want to close the handle right away.
diff --git a/python/t/010-basic.py b/python/t/010-basic.py
index a97f3d24..779af484 100644
--- a/python/t/010-basic.py
+++ b/python/t/010-basic.py
@@ -31,6 +31,7 @@ g.lvcreate ("LV1", "VG", 200)
g.lvcreate ("LV2", "VG", 200)
if (g.lvs () != ["/dev/VG/LV1", "/dev/VG/LV2"]):
raise "Error: g.lvs() returned incorrect result"
+g.shutdown ()
g.close ()
os.unlink ("test.img")