python/pso tests: use string .format() style rather than C-style %s/%d.
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 15 Aug 2018 05:21:43 +0000 (17:21 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 17 Aug 2018 00:58:26 +0000 (02:58 +0200)
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/pso.py

index 8ca86be5e804d6f7bc8a6abd37ccbcff3f09ba34..76c8d46e90b4c6bf2f2ba8a0dfd74446ade95824 100644 (file)
@@ -226,21 +226,21 @@ class PasswordSettings:
 
         # all the following fields are mandatory for the PSO object
         ldif = """
-dn: %s
+dn: {}
 objectClass: msDS-PasswordSettings
-msDS-PasswordSettingsPrecedence: %u
-msDS-PasswordReversibleEncryptionEnabled: %s
-msDS-PasswordHistoryLength: %u
-msDS-PasswordComplexityEnabled: %s
-msDS-MinimumPasswordLength: %u
-msDS-MinimumPasswordAge: %d
-msDS-MaximumPasswordAge: %d
-msDS-LockoutThreshold: %u
-msDS-LockoutObservationWindow: %d
-msDS-LockoutDuration: %d
-""" % (self.dn, self.precedence, plaintext_str, self.history_len,
-       complexity_str, self.password_len, min_age, max_age,
-       self.lockout_attempts, lockout_window, lockout_duration)
+msDS-PasswordSettingsPrecedence: {}
+msDS-PasswordReversibleEncryptionEnabled: {}
+msDS-PasswordHistoryLength: {}
+msDS-PasswordComplexityEnabled: {}
+msDS-MinimumPasswordLength: {}
+msDS-MinimumPasswordAge: {}
+msDS-MaximumPasswordAge: {}
+msDS-LockoutThreshold: {}
+msDS-LockoutObservationWindow: {}
+msDS-LockoutDuration: {}
+""".format(self.dn, self.precedence, plaintext_str, self.history_len,
+           complexity_str, self.password_len, min_age, max_age,
+           self.lockout_attempts, lockout_window, lockout_duration)
 
         return ldif