Merge "Fix pylint error"
This commit is contained in:
commit
30ce858564
|
@ -38,8 +38,7 @@ class BaseOS(object):
|
||||||
@classmethod
|
@classmethod
|
||||||
def _get_subclasses(cls):
|
def _get_subclasses(cls):
|
||||||
for subclass in cls.__subclasses__():
|
for subclass in cls.__subclasses__():
|
||||||
for sc in subclass._get_subclasses():
|
yield from subclass._get_subclasses()
|
||||||
yield sc
|
|
||||||
yield subclass
|
yield subclass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -164,16 +164,14 @@ def _parse_pkcs7_bundle(pkcs7):
|
||||||
if PKCS7_BEG in pkcs7:
|
if PKCS7_BEG in pkcs7:
|
||||||
try:
|
try:
|
||||||
for substrate in _read_pem_blocks(pkcs7):
|
for substrate in _read_pem_blocks(pkcs7):
|
||||||
for cert in _get_certs_from_pkcs7_substrate(substrate):
|
yield from _get_certs_from_pkcs7_substrate(substrate)
|
||||||
yield cert
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.exception('Unreadable Certificate.')
|
LOG.exception('Unreadable Certificate.')
|
||||||
raise exceptions.UnreadableCert from e
|
raise exceptions.UnreadableCert from e
|
||||||
|
|
||||||
# If no PEM encoding, assume this is DER encoded and try to decode
|
# If no PEM encoding, assume this is DER encoded and try to decode
|
||||||
else:
|
else:
|
||||||
for cert in _get_certs_from_pkcs7_substrate(pkcs7):
|
yield from _get_certs_from_pkcs7_substrate(pkcs7)
|
||||||
yield cert
|
|
||||||
|
|
||||||
|
|
||||||
def _read_pem_blocks(data):
|
def _read_pem_blocks(data):
|
||||||
|
|
|
@ -204,8 +204,7 @@ class NoopManager(object):
|
||||||
return len(self.known_subnets) + 1
|
return len(self.known_subnets) + 1
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
for subnet_id in self.known_subnets:
|
yield from self.known_subnets
|
||||||
yield subnet_id
|
|
||||||
subnet = network_models.Subnet(id=uuidutils.generate_uuid(),
|
subnet = network_models.Subnet(id=uuidutils.generate_uuid(),
|
||||||
network_id=self.network.id)
|
network_id=self.network.id)
|
||||||
self.known_subnets[subnet.id] = subnet
|
self.known_subnets[subnet.id] = subnet
|
||||||
|
|
Loading…
Reference in New Issue