summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorAlexander Bokovoy <abokovoy@redhat.com>2012-09-20 14:02:15 +0300
committerMartin Kosek <mkosek@redhat.com>2012-09-20 14:57:07 +0200
commit9d84a3cf49906548390845b4c30482d702f679bf (patch)
treeffe3a21679831c042655d67ac69c346b508b9545 /ipalib
parent87a37c8e2f9ee4900f533f0c455c7bbf28f5987a (diff)
downloadfreeipa-9d84a3cf49906548390845b4c30482d702f679bf.tar.gz
freeipa-9d84a3cf49906548390845b4c30482d702f679bf.tar.xz
freeipa-9d84a3cf49906548390845b4c30482d702f679bf.zip
Fix error messages and use proper ImportError for dcerpc import
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/group.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/ipalib/plugins/group.py b/ipalib/plugins/group.py
index 011587206..ae00aa8ac 100644
--- a/ipalib/plugins/group.py
+++ b/ipalib/plugins/group.py
@@ -26,7 +26,7 @@ if api.env.in_server and api.env.context in ['lite', 'server']:
try:
import ipaserver.dcerpc
_dcerpc_bindings_installed = True
- except Exception, e:
+ except ImportError:
_dcerpc_bindings_installed = False
__doc__ = _("""
@@ -328,14 +328,13 @@ class group_add_member(LDAPAddMember):
result = (completed, dn)
if 'ipaexternalmember' in options:
if not _dcerpc_bindings_installed:
- raise errors.NotFound(name=_('AD Trust'),
- reason=_('''Cannot perform external member validation without Samba 4 support installed.
- Make sure you have installed server-trust-ad sub-package of IPA on the server'''))
+ raise errors.NotFound(reason=_('Cannot perform external member validation without '
+ 'Samba 4 support installed. Make sure you have installed '
+ 'server-trust-ad sub-package of IPA on the server'))
domain_validator = ipaserver.dcerpc.DomainValidator(self.api)
if not domain_validator.is_configured():
- raise errors.NotFound(name=_('AD Trust setup'),
- reason=_('''Cannot perform join operation without own domain configured.
- Make sure you have run ipa-adtrust-install on the IPA server first'''))
+ raise errors.NotFound(reason=_('Cannot perform join operation without own domain configured. '
+ 'Make sure you have run ipa-adtrust-install on the IPA server first'))
sids = []
failed_sids = []
for sid in options['ipaexternalmember']: