summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2014-08-01 12:06:36 +0200
committerTomas Babej <tbabej@redhat.com>2014-09-17 14:41:50 +0200
commit47fb94bf7cb4cb5b91ba76ac5eac1d39c556d59a (patch)
treefc98bbedf37e29dfa1c5e6eb9e7dd3adc353fe71
parent59925e9bfc8156ffc356810d3ec57a1bdf5c8fc4 (diff)
downloadfreeipa-47fb94bf7cb4cb5b91ba76ac5eac1d39c556d59a.zip
freeipa-47fb94bf7cb4cb5b91ba76ac5eac1d39c556d59a.tar.gz
freeipa-47fb94bf7cb4cb5b91ba76ac5eac1d39c556d59a.tar.xz
ipalib: Remove redundant and star imports from host plugin
Also fixes incorrect error catching for UnicodeDecodeError. Part of: https://fedorahosted.org/freeipa/ticket/3979
-rw-r--r--ipalib/plugins/host.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index ce904b7..1dc47c7 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -18,18 +18,17 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import platform
-import os
-import sys
from nss.error import NSPRError
-import nss.nss as nss
-import netaddr
import string
from ipalib import api, errors, util
from ipalib import Str, Flag, Bytes, DNParam
from ipalib.plugable import Registry
-from ipalib.plugins.baseldap import *
+from ipalib.plugins.baseldap import (LDAPQuery, LDAPObject, LDAPCreate,
+ LDAPDelete, LDAPUpdate, LDAPSearch,
+ LDAPRetrieve, LDAPAddMember,
+ LDAPRemoveMember, host_is_master,
+ pkey_to_value)
from ipalib.plugins.service import (split_principal, validate_certificate,
set_certificate_attrs, ticket_flags_params, update_krbticketflags,
set_kerberos_attrs)
@@ -38,6 +37,7 @@ from ipalib.plugins.dns import (dns_container_exists, _record_types,
get_reverse_zone)
from ipalib import _, ngettext
from ipalib import x509
+from ipalib import output
from ipalib.request import context
from ipalib.util import (normalize_sshpubkey, validate_sshpubkey_no_options,
convert_sshpubkey_post, validate_hostname)
@@ -139,13 +139,13 @@ def update_sshfp_record(zone, record, entry_attrs):
for pubkey in pubkeys:
try:
sshfp = SSHPublicKey(pubkey).fingerprint_dns_sha1()
- except ValueError, UnicodeDecodeError:
+ except (ValueError, UnicodeDecodeError):
continue
if sshfp is not None:
sshfps.append(sshfp)
try:
sshfp = SSHPublicKey(pubkey).fingerprint_dns_sha256()
- except ValueError, UnicodeDecodeError:
+ except (ValueError, UnicodeDecodeError):
continue
if sshfp is not None:
sshfps.append(sshfp)