Skip to content

Commit

Permalink
fix: add guards to AWS client start
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanholz committed Aug 22, 2024
1 parent df67ec4 commit dba0636
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gha_runner/clouddeployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ def create_instances(self) -> dict[str, str]:
raise ValueError(
"No region name provided, cannot create instances."
)
ec2 = boto3.client("ec2", region_name=self.region_name)
if self.region_name is None:
ec2 = boto3.client("ec2")
else:
ec2 = boto3.client("ec2", region_name=self.region_name)
id_dict = {}
for token in self.gh_runner_tokens:
label = GitHubInstance.generate_random_label()
Expand Down

0 comments on commit dba0636

Please sign in to comment.