python/samdb: properly use property()
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 25 Oct 2018 09:09:59 +0000 (22:09 +1300)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 29 Oct 2018 19:09:25 +0000 (20:09 +0100)
Python's property() function works like this:

property([getter[, setter[, delete[, doc]]]])

but we have been forgetting the delete function, or rather setting it
to be a string. A string is not callable and is unlikely to succeed at
deleting the property.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
python/samba/samdb.py

index fa3e4b1b33405a41849fcf766bdcae389b8885de..1abd94b193843988f87f4e48f1b98f618336ea79 100644 (file)
@@ -676,7 +676,7 @@ accountExpires: %u
         return dsdb._samdb_get_domain_sid(self)
 
     domain_sid = property(get_domain_sid, set_domain_sid,
-                          "SID for the domain")
+                          doc="SID for the domain")
 
     def set_invocation_id(self, invocation_id):
         """Set the invocation id for this SamDB handle.
@@ -690,7 +690,7 @@ accountExpires: %u
         return dsdb._samdb_ntds_invocation_id(self)
 
     invocation_id = property(get_invocation_id, set_invocation_id,
-                             "Invocation ID GUID")
+                             doc="Invocation ID GUID")
 
     def get_oid_from_attid(self, attid):
         return dsdb._dsdb_get_oid_from_attid(self, attid)