77# Changes may cause incorrect behavior and will be lost if the code is
88# regenerated.
99# --------------------------------------------------------------------------
10- # pylint: disable=too-many-lines
10+ # pylint: disable=too-many-lines, line-too-long, protected-access
1111
1212import base64
1313import jwt
1818from cryptography .hazmat .primitives .serialization import Encoding
1919from cryptography .x509 import load_pem_x509_certificate
2020
21- from azext_attestation .aaz .latest .attestation import Create as _AttestationCreate , Delete as _AttestationDelete ,\
21+ from azext_attestation .aaz .latest .attestation import Create as _AttestationCreate , Delete as _AttestationDelete , \
2222 Show as _AttestationShow , GetDefaultByLocation as _AttestationGetDefaultByLocation
2323from azext_attestation .aaz .latest .attestation .policy import Reset as _ResetPolicy , Set as _SetPolicy , Show as _GetPolicy
24- from azext_attestation .aaz .latest .attestation .signer import Add as _AddSigner , Remove as _RemoveSigner ,\
24+ from azext_attestation .aaz .latest .attestation .signer import Add as _AddSigner , Remove as _RemoveSigner , \
2525 List as _ListSigners
2626from azure .cli .core .aaz import has_value
2727from azure .cli .core .azclierror import ArgumentUsageError
@@ -184,7 +184,7 @@ def pre_operations(self):
184184 signer = f .read ()
185185
186186 if signer :
187- if type (signer ) == bytes :
187+ if isinstance (signer , bytes ) :
188188 args .signer = str (signer , encoding = "utf-8" )
189189 else :
190190 args .signer = signer
@@ -246,15 +246,15 @@ def pre_operations(self):
246246 signer = f .read ()
247247
248248 if signer :
249- if type (signer ) == bytes :
249+ if isinstance (signer , bytes ) :
250250 args .signer = str (signer , encoding = "utf-8" )
251251 else :
252252 args .signer = signer
253253
254254 def _output (self , * args , ** kwargs ):
255255 args = self .ctx .args
256256 list_args = {"resource_group" : args .resource_group , "provider_name" : args .provider_name }
257- from azext_attestation .aaz .latest .attestation .signer import List
257+ from azext_attestation .aaz .latest .attestation .signer import List # pylint: disable=reimported
258258 token = List (cli_ctx = self .cli_ctx )(command_args = list_args )['token' ]
259259 result = {'Jwt' : token }
260260 if has_value (token ):
@@ -398,7 +398,8 @@ def pre_operations(self):
398398 validate_provider_resource_id (self )
399399
400400 if has_value (args .new_attestation_policy_file ) and has_value (args .new_attestation_policy ):
401- raise ArgumentUsageError ('Please specify just one of --new-attestation-policy and --new-attestation-policy-file/-f' )
401+ raise ArgumentUsageError (
402+ 'Please specify just one of --new-attestation-policy and --new-attestation-policy-file/-f' )
402403
403404 if not has_value (args .new_attestation_policy_file ) and not has_value (args .new_attestation_policy ):
404405 raise ArgumentUsageError ('Please specify --new-attestation-policy or --new-attestation-policy-file/-f' )
@@ -416,7 +417,7 @@ def pre_operations(self):
416417 new_attestation_policy = f .read ()
417418
418419 show_args = {"resource_group" : args .resource_group , "provider_name" : args .provider_name }
419- from azext_attestation .aaz .latest .attestation import Show
420+ from azext_attestation .aaz .latest .attestation import Show # pylint: disable=reimported
420421 provider = Show (cli_ctx = self .cli_ctx )(command_args = show_args )
421422
422423 if args .policy_format == 'Text' :
@@ -434,17 +435,19 @@ def pre_operations(self):
434435 )
435436 except TypeError as e :
436437 print (e )
437- raise ArgumentUsageError ('Failed to encode text content, are you using JWT? If yes, please use --policy-format JWT' )
438+ raise ArgumentUsageError (
439+ 'Failed to encode text content, are you using JWT? If yes, please use --policy-format JWT' )
438440
439441 if new_attestation_policy :
440- if type (new_attestation_policy ) == bytes :
442+ if isinstance (new_attestation_policy , bytes ) :
441443 args .new_attestation_policy = str (new_attestation_policy , encoding = "utf-8" )
442444 else :
443445 args .new_attestation_policy = new_attestation_policy
444446
445447 def _output (self , * args , ** kwargs ):
446448 args = self .ctx .args
447- show_args = {"resource_group" : args .resource_group , "name" : args .name , "attestation_type" : args .attestation_type }
449+ show_args = {"resource_group" : args .resource_group , "name" : args .name ,
450+ "attestation_type" : args .attestation_type }
448451 return GetPolicy (cli_ctx = self .cli_ctx )(command_args = show_args )
449452
450453
@@ -490,7 +493,8 @@ def pre_operations(self):
490493
491494 def _output (self , * args , ** kwargs ):
492495 args = self .ctx .args
493- show_args = {"resource_group" : args .resource_group , "name" : args .name , "attestation_type" : args .attestation_type }
496+ show_args = {"resource_group" : args .resource_group , "name" : args .name ,
497+ "attestation_type" : args .attestation_type }
494498 return GetPolicy (cli_ctx = self .cli_ctx )(command_args = show_args )
495499
496500
0 commit comments