From f39d855af446f5a98a16cbd8971d2f2463b019af Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Feb 07 2018 16:27:11 +0000 Subject: DNSSEC: Reformat lines to address PEP8 violations Signed-off-by: Christian Heimes Reviewed-By: Stanislav Laznicka --- diff --git a/ipaserver/dnssec/bindmgr.py b/ipaserver/dnssec/bindmgr.py index 9224c21..1b02bff 100644 --- a/ipaserver/dnssec/bindmgr.py +++ b/ipaserver/dnssec/bindmgr.py @@ -58,7 +58,10 @@ class BINDMgr(object): def time_ldap2bindfmt(self, str_val): if isinstance(str_val, bytes): str_val = str_val.decode('utf-8') - dt = datetime.strptime(str_val, ipalib.constants.LDAP_GENERALIZED_TIME_FORMAT) + dt = datetime.strptime( + str_val, + ipalib.constants.LDAP_GENERALIZED_TIME_FORMAT + ) return dt.strftime(time_bindfmt).encode('utf-8') def dates2params(self, ldap_attrs): diff --git a/ipaserver/dnssec/keysyncer.py b/ipaserver/dnssec/keysyncer.py index 958ebb3..2351a09 100644 --- a/ipaserver/dnssec/keysyncer.py +++ b/ipaserver/dnssec/keysyncer.py @@ -47,7 +47,11 @@ class KeySyncer(SyncReplConsumer): Given set of attributes has to have exactly one supported object class. """ supported_objclasses = {b'idnszone', b'idnsseckey', b'ipk11publickey'} - present_objclasses = set([o.lower() for o in attrs[OBJCLASS_ATTR]]).intersection(supported_objclasses) + present_objclasses = set( + o.lower() for o in attrs[OBJCLASS_ATTR] + ).intersection( + supported_objclasses + ) assert len(present_objclasses) == 1, attrs[OBJCLASS_ATTR] return present_objclasses.pop() diff --git a/ipaserver/dnssec/ldapkeydb.py b/ipaserver/dnssec/ldapkeydb.py index 99e8a40..143221c 100644 --- a/ipaserver/dnssec/ldapkeydb.py +++ b/ipaserver/dnssec/ldapkeydb.py @@ -299,13 +299,16 @@ class LdapKeyDB(AbstractHSM): for attr in default_attrs: key.setdefault(attr, default_attrs[attr]) - assert 'ipk11id' in key, 'key is missing ipk11Id in %s' % key.entry.dn + assert 'ipk11id' in key, \ + 'key is missing ipk11Id in %s' % key.entry.dn key_id = key['ipk11id'] assert key_id not in keys, \ 'duplicate ipk11Id=0x%s in "%s" and "%s"' % \ (str_hexlify(key_id), key.entry.dn, keys[key_id].entry.dn) - assert 'ipk11label' in key, 'key "%s" is missing ipk11Label' % key.entry.dn - assert 'objectclass' in key.entry, 'key "%s" is missing objectClass attribute' % key.entry.dn + assert 'ipk11label' in key, \ + 'key "%s" is missing ipk11Label' % key.entry.dn + assert 'objectclass' in key.entry, \ + 'key "%s" is missing objectClass attribute' % key.entry.dn keys[key_id] = key @@ -399,12 +402,13 @@ class LdapKeyDB(AbstractHSM): for key in keys.values(): prefix = 'dnssec-master' assert key['ipk11label'] == prefix, \ - 'secret key dn="%s" ipk11id=0x%s ipk11label="%s" with ipk11UnWrap = TRUE does not have '\ - '"%s" key label' % ( + 'secret key dn="%s" ipk11id=0x%s ipk11label="%s" with ' \ + 'ipk11UnWrap = TRUE does not have "%s" key label' % ( key.entry.dn, str_hexlify(key['ipk11id']), str(key['ipk11label']), - prefix) + prefix + ) self.cache_masterkeys = keys return keys diff --git a/ipaserver/dnssec/localhsm.py b/ipaserver/dnssec/localhsm.py index c0179ad..55a12f1 100755 --- a/ipaserver/dnssec/localhsm.py +++ b/ipaserver/dnssec/localhsm.py @@ -18,7 +18,6 @@ from ipaserver.dnssec.abshsm import (attrs_name2id, attrs_id2name, AbstractHSM, from ipaserver.dnssec.ldapkeydb import str_hexlify - private_key_api_params = set(["label", "id", "data", "unwrapping_key", "wrapping_mech", "key_type", "cka_always_authenticate", "cka_copyable", "cka_decrypt", "cka_derive", "cka_extractable", "cka_modifiable", @@ -139,9 +138,11 @@ class LocalHSM(AbstractHSM): for key in keys.values(): prefix = 'dnssec-master' assert key['ipk11label'] == prefix, \ - 'secret key ipk11id=0x%s ipk11label="%s" with ipk11UnWrap = TRUE does not have '\ - '"%s" key label' % (str_hexlify(key['ipk11id']), - str(key['ipk11label']), prefix) + 'secret key ipk11id=0x%s ipk11label="%s" with ipk11UnWrap ' \ + '= TRUE does not have "%s" key label' % ( + str_hexlify(key['ipk11id']), + str(key['ipk11label']), prefix + ) return keys