python: Fix optargs so we don't use special sentinel values.

Previously with Python it was impossible to set a boolean or integer
optarg to -1 because that was used as a special sentinel value to
indicate that the optarg was not set.

Instead, use None as the sentinel value, since that cannot be a
boolean or integer type.
This commit is contained in:
Richard W.M. Jones
2012-08-15 12:14:39 +01:00
parent e990e80c26
commit 42e8c093b7
2 changed files with 36 additions and 50 deletions

View File

@@ -20,6 +20,6 @@ import guestfs
g = guestfs.GuestFS()
g.add_drive ("/dev/null")
g.add_drive ("/dev/null", readonly = 1)
g.add_drive ("/dev/null", readonly = True)
g.add_drive ("/dev/null", iface = "virtio", format = "raw")
g.close ()