summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/ldapupdate.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-08-12 13:49:54 +0200
committerJan Cholasta <jcholast@redhat.com>2015-09-01 11:42:01 +0200
commitd1187cbc6ffc855e1bd42cd65110ba0567293ce6 (patch)
treea0fb75e5cd7db6e4e19632710a91a536f6f11f0b /ipaserver/install/ldapupdate.py
parent8de13bd7dd76f5f5b23d6e4fb84be1a2f1dc5c5e (diff)
downloadfreeipa-d1187cbc6ffc855e1bd42cd65110ba0567293ce6.tar.gz
freeipa-d1187cbc6ffc855e1bd42cd65110ba0567293ce6.tar.xz
freeipa-d1187cbc6ffc855e1bd42cd65110ba0567293ce6.zip
Use new-style raise syntax
The form`raise Error, value` is deprecated in favor of `raise Error(value)`, and will be removed in Python 3. Use the new syntax. Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/install/ldapupdate.py')
-rw-r--r--ipaserver/install/ldapupdate.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py
index 0444327aa..4457edc4c 100644
--- a/ipaserver/install/ldapupdate.py
+++ b/ipaserver/install/ldapupdate.py
@@ -369,19 +369,19 @@ class LDAPUpdate:
items = logical_line.split(':', 2)
if len(items) == 0:
- raise BadSyntax, "Bad formatting on line %s:%d: %s" % (data_source_name, lcount, logical_line)
+ raise BadSyntax("Bad formatting on line %s:%d: %s" % (data_source_name, lcount, logical_line))
action = items[0].strip().lower()
if action not in self.action_keywords:
- raise BadSyntax, "Unknown update action '%s', data source=%s" % (action, data_source_name)
+ raise BadSyntax("Unknown update action '%s', data source=%s" % (action, data_source_name))
if action == 'deleteentry':
new_value = None
disposition = "deleteentry"
else:
if len(items) != 3:
- raise BadSyntax, "Bad formatting on line %s:%d: %s" % (data_source_name, lcount, logical_line)
+ raise BadSyntax("Bad formatting on line %s:%d: %s" % (data_source_name, lcount, logical_line))
attr = items[1].strip()
# do not strip here, we need detect '::' due to base64 encoded
@@ -497,7 +497,7 @@ class LDAPUpdate:
else:
# Process items belonging to dn
if dn is None:
- raise BadSyntax, "dn is not defined in the update, data source=%s" % (data_source_name)
+ raise BadSyntax("dn is not defined in the update, data source=%s" % (data_source_name))
# If continuation line, append to existing logical line & continue,
# otherwise flush the previous item.
@@ -736,7 +736,7 @@ class LDAPUpdate:
e = self._get_entry(new_entry.dn)
if len(e) > 1:
# we should only ever get back one entry
- raise BadSyntax, "More than 1 entry returned on a dn search!? %s" % new_entry.dn
+ raise BadSyntax("More than 1 entry returned on a dn search!? %s" % new_entry.dn)
entry = e[0]
found = True
self.debug("Updating existing entry: %s", entry.dn)