Skip to content

Commit 6c6b732

Browse files
fix: CI for Decrypt Oracle (aws#558)
1 parent 2326531 commit 6c6b732

File tree

2 files changed

+27
-29
lines changed

2 files changed

+27
-29
lines changed

decrypt_oracle/.chalice/pipeline.py

+27-28
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
CODEBUILD_IMAGE = "aws/codebuild/standard:5.0"
2727
BUILDSPEC = "decrypt_oracle/.chalice/buildspec.yaml"
2828
GITHUB_REPO = "aws-encryption-sdk-python"
29-
WAITER_CONFIG = dict(Delay=10)
29+
WAITER_CONFIG = {"Delay": 10}
3030
_LOGGER = logging.getLogger("Decrypt Oracle Build Pipeline Deployer")
3131

3232

@@ -35,7 +35,7 @@ class AllowEverywhere(AWS.Statement):
3535

3636
def __init__(self, *args, **kwargs):
3737
"""Set up override values."""
38-
my_kwargs = dict(Effect=AWS.Allow, Resource=["*"])
38+
my_kwargs = {"Effect": AWS.Allow, "Resource": ["*"]}
3939
my_kwargs.update(kwargs)
4040
super().__init__(*args, **my_kwargs)
4141

@@ -167,13 +167,13 @@ def _pipeline(
167167
ActionTypeId=codepipeline.ActionTypeId(
168168
Category="Source", Owner="ThirdParty", Version="1", Provider="GitHub"
169169
),
170-
Configuration=dict(
171-
Owner=github_owner,
172-
Repo=GITHUB_REPO,
173-
OAuthToken=Ref(github_access_token),
174-
Branch=github_branch,
175-
PollForSourceChanges=True,
176-
),
170+
Configuration={
171+
"Owner": github_owner,
172+
"Repo": GITHUB_REPO,
173+
"OAuthToken": Ref(github_access_token),
174+
"Branch": github_branch,
175+
"PollForSourceChanges": True,
176+
},
177177
)
178178
],
179179
)
@@ -191,7 +191,7 @@ def _pipeline(
191191
ActionTypeId=codepipeline.ActionTypeId(
192192
Category="Build", Owner="AWS", Version="1", Provider="CodeBuild"
193193
),
194-
Configuration=dict(ProjectName=Ref(codebuild_builder)),
194+
Configuration={"ProjectName": Ref(codebuild_builder)},
195195
)
196196
],
197197
)
@@ -200,25 +200,25 @@ def _pipeline(
200200
RunOrder="1",
201201
ActionTypeId=codepipeline.ActionTypeId(Category="Deploy", Owner="AWS", Version="1", Provider="CloudFormation"),
202202
InputArtifacts=[codepipeline.InputArtifacts(Name=_compiled_cfn_template)],
203-
Configuration=dict(
204-
ActionMode="CHANGE_SET_REPLACE",
205-
ChangeSetName=_changeset_name,
206-
RoleArn=GetAtt(cfn_role, "Arn"),
207-
Capabilities="CAPABILITY_IAM",
208-
StackName=_stack_name,
209-
TemplatePath="{}::decrypt_oracle/transformed.yaml".format(_compiled_cfn_template),
210-
),
203+
Configuration={
204+
"ActionMode": "CHANGE_SET_REPLACE",
205+
"ChangeSetName": _changeset_name,
206+
"RoleArn": GetAtt(cfn_role, "Arn"),
207+
"Capabilities": "CAPABILITY_IAM",
208+
"StackName": _stack_name,
209+
"TemplatePath": "{}::decrypt_oracle/transformed.yaml".format(_compiled_cfn_template),
210+
},
211211
)
212212
deploy_changeset = codepipeline.Actions(
213213
Name="Deploy",
214214
RunOrder="2",
215215
ActionTypeId=codepipeline.ActionTypeId(Category="Deploy", Owner="AWS", Version="1", Provider="CloudFormation"),
216-
Configuration=dict(
217-
ActionMode="CHANGE_SET_EXECUTE",
218-
ChangeSetName=_changeset_name,
219-
StackName=_stack_name,
220-
OutputFileName="StackOutputs.json",
221-
),
216+
Configuration={
217+
"ActionMode": "CHANGE_SET_EXECUTE",
218+
"ChangeSetName": _changeset_name,
219+
"StackName": _stack_name,
220+
"OutputFileName": "StackOutputs.json",
221+
},
222222
OutputArtifacts=[codepipeline.OutputArtifacts(Name="AppDeploymentValues")],
223223
)
224224
deploy = codepipeline.Stages(Name="Deploy", Actions=[stage_changeset, deploy_changeset])
@@ -272,8 +272,7 @@ def _stack_exists(cloudformation) -> bool:
272272
return False
273273
raise
274274

275-
else:
276-
return True
275+
return True
277276

278277

279278
def _update_existing_stack(cloudformation, template: Template, github_token: str) -> None:
@@ -284,7 +283,7 @@ def _update_existing_stack(cloudformation, template: Template, github_token: str
284283
cloudformation.update_stack(
285284
StackName=PIPELINE_STACK_NAME,
286285
TemplateBody=template.to_json(),
287-
Parameters=[dict(ParameterKey="GithubPersonalToken", ParameterValue=github_token)],
286+
Parameters=[{"ParameterKey": "GithubPersonalToken", "ParameterValue": github_token}],
288287
Capabilities=["CAPABILITY_IAM"],
289288
)
290289
_LOGGER.info("Waiting for stack update to complete...")
@@ -301,7 +300,7 @@ def _deploy_new_stack(cloudformation, template: Template, github_token: str) ->
301300
cloudformation.create_stack(
302301
StackName=PIPELINE_STACK_NAME,
303302
TemplateBody=template.to_json(),
304-
Parameters=[dict(ParameterKey="GithubPersonalToken", ParameterValue=github_token)],
303+
Parameters=[{"ParameterKey": "GithubPersonalToken", "ParameterValue": github_token}],
305304
Capabilities=["CAPABILITY_IAM"],
306305
)
307306
_LOGGER.info("Waiting for stack to deploy...")

decrypt_oracle/src/pylintrc

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[MESSAGES CONTROL]
22
# Disabling messages that we either don't care about for tests or are necessary to break for tests.
33
disable =
4-
bad-continuation, # we let black handle this
54
ungrouped-imports, # we let isort handle this
65
consider-using-f-string # disable until 2022-05-05; 6 months after 3.5 deprecation
76

0 commit comments

Comments
 (0)