2
0
mirror of https://github.com/openkmip/pykmip synced 2025-12-22 03:03:16 +00:00

Fix flake8 warnings to reflect modern Python style

This commit is contained in:
Peter Hamilton
2019-02-01 11:00:29 -05:00
committed by Peter Hamilton
parent 7648ea801b
commit c012a430aa
3 changed files with 58 additions and 58 deletions

View File

@@ -1559,7 +1559,7 @@ class KmipEngine(object):
if attribute_name == 'Name':
names = attr
if attribute_value not in names:
break
break
# TODO: filtering on other attributes
else:
managed_objects_filtered.append(managed_object)
@@ -2045,12 +2045,12 @@ class KmipEngine(object):
"for encryption."
)
if enums.CryptographicUsageMask.ENCRYPT not in \
managed_object.cryptographic_usage_masks:
raise exceptions.PermissionDenied(
"The Encrypt bit must be set in the encryption key's "
"cryptographic usage mask."
)
masks = managed_object.cryptographic_usage_masks
if enums.CryptographicUsageMask.ENCRYPT not in masks:
raise exceptions.PermissionDenied(
"The Encrypt bit must be set in the encryption key's "
"cryptographic usage mask."
)
result = self._cryptography_engine.encrypt(
cryptographic_parameters.cryptographic_algorithm,
@@ -2108,12 +2108,12 @@ class KmipEngine(object):
"for decryption."
)
if enums.CryptographicUsageMask.DECRYPT not in \
managed_object.cryptographic_usage_masks:
raise exceptions.PermissionDenied(
"The Decrypt bit must be set in the decryption key's "
"cryptographic usage mask."
)
masks = managed_object.cryptographic_usage_masks
if enums.CryptographicUsageMask.DECRYPT not in masks:
raise exceptions.PermissionDenied(
"The Decrypt bit must be set in the decryption key's "
"cryptographic usage mask."
)
result = self._cryptography_engine.decrypt(
cryptographic_parameters.cryptographic_algorithm,
@@ -2251,12 +2251,12 @@ class KmipEngine(object):
"Object is not in a state that can be used for MACing."
)
if enums.CryptographicUsageMask.MAC_GENERATE not in \
managed_object.cryptographic_usage_masks:
raise exceptions.PermissionDenied(
"MAC Generate must be set in the object's cryptographic "
"usage mask"
)
masks = managed_object.cryptographic_usage_masks
if enums.CryptographicUsageMask.MAC_GENERATE not in masks:
raise exceptions.PermissionDenied(
"MAC Generate must be set in the object's cryptographic "
"usage mask"
)
result = self._cryptography_engine.mac(
algorithm,