python: This function converts days to a relative (ie negative) NTTIME
authorAndrew Bartlett <abartlet@samba.org>
Tue, 24 Oct 2017 02:59:37 +0000 (15:59 +1300)
committerGarming Sam <garming@samba.org>
Mon, 20 Nov 2017 20:41:15 +0000 (21:41 +0100)
It is not nttime2unix as it claimed.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/gpclass.py

index b13c117dd2d72039f5bf1a2de576b6dbdabcb3e2..c955005ad1917147f1b5540737ac84ef5e869325 100644 (file)
@@ -360,7 +360,7 @@ class inf_to_ldb(inf_to):
         self.gp_db.store(str(self), self.attribute, old_val)
         self.ldb.set_pwdProperties(val)
 
         self.gp_db.store(str(self), self.attribute, old_val)
         self.ldb.set_pwdProperties(val)
 
-    def nttime2unix(self):
+    def days2rel_nttime(self):
         seconds = 60
         minutes = 60
         hours = 24
         seconds = 60
         minutes = 60
         hours = 24
@@ -371,8 +371,8 @@ class inf_to_ldb(inf_to):
 
     def mapper(self):
         '''ldap value : samba setter'''
 
     def mapper(self):
         '''ldap value : samba setter'''
-        return { "minPwdAge" : (self.ch_minPwdAge, self.nttime2unix),
-                 "maxPwdAge" : (self.ch_maxPwdAge, self.nttime2unix),
+        return { "minPwdAge" : (self.ch_minPwdAge, self.days2rel_nttime),
+                 "maxPwdAge" : (self.ch_maxPwdAge, self.days2rel_nttime),
                  # Could be none, but I like the method assignment in update_samba
                  "minPwdLength" : (self.ch_minPwdLength, self.explicit),
                  "pwdProperties" : (self.ch_pwdProperties, self.explicit),
                  # Could be none, but I like the method assignment in update_samba
                  "minPwdLength" : (self.ch_minPwdLength, self.explicit),
                  "pwdProperties" : (self.ch_pwdProperties, self.explicit),