File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed
src/aibs_informatics_aws_utils Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -145,15 +145,11 @@ def get_region(region: Optional[str] = None) -> str:
145145
146146def get_account_id () -> str :
147147 """Will get the account id from the current credentials/identity"""
148- account = get_caller_identity ().get ("Account" )
149- assert account is not None # mollify mypy
150- return account
148+ return get_caller_identity ()["Account" ]
151149
152150
153151def get_user_id () -> UserId :
154- user_id = UserId (get_caller_identity ()["UserId" ])
155- assert user_id is not None # mollify mypy
156- return user_id
152+ return UserId (get_caller_identity ()["UserId" ])
157153
158154
159155def get_iam_arn () -> IAMArn :
Original file line number Diff line number Diff line change @@ -589,7 +589,7 @@ def get_resource_tags(self) -> List[ResourceTag]:
589589 return [
590590 ResourceTag (Key = tag ["Key" ], Value = tag ["Value" ])
591591 for tag in self .client .list_tags_for_resource (resourceArn = self .arn )["tags" ]
592- if tag . get ( "Key" ) and tag . get ( "Value" )
592+ if "Key" in tag and "Value" in tag
593593 ]
594594
595595 def update_resource_tags (
Original file line number Diff line number Diff line change @@ -169,10 +169,8 @@ def list_efs_access_points(
169169 for fs_id in file_system_ids :
170170 response = efs .describe_access_points (FileSystemId = fs_id )
171171 access_points .extend (response ["AccessPoints" ])
172- while response .get ("NextToken" ):
173- response = efs .describe_access_points (
174- FileSystemId = fs_id , NextToken = response ["NextToken" ]
175- )
172+ while next_token := response .get ("NextToken" ):
173+ response = efs .describe_access_points (FileSystemId = fs_id , NextToken = next_token )
176174 access_points .extend (response ["AccessPoints" ])
177175
178176 filtered_access_points : List [AccessPointDescriptionTypeDef ] = []
You can’t perform that action at this time.
0 commit comments