Skip to content

Commit

Permalink
fix extend warning and ignore type errors from existing code
Browse files Browse the repository at this point in the history
  • Loading branch information
timbrown5 committed Jan 20, 2025
1 parent 3ba3d68 commit a623a14
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions runner_manager/backend/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ def _create_from_subnet_config(
)
concrete_instance_config = deepcopy(self.instance_config)
concrete_instance_config.subnet_id = subnet_config["subnet_id"]
concrete_instance_config.security_group_ids.extend(
subnet_config.get("security_group_ids", [])
)
subnet_security_groups = subnet_config.get("security_group_ids", [])
if subnet_security_groups:
security_groups = list(concrete_instance_config.security_group_ids)
security_groups += subnet_security_groups
concrete_instance_config.security_group_ids = security_groups
instance_resource: AwsInstance = (
concrete_instance_config.configure_instance(runner)
)
Expand All @@ -90,8 +92,8 @@ def _create_from_subnet_config(
return runner

def _create(self, runner: Runner, instance_resource: AwsInstance) -> Runner:
instance = self.client.run_instances(**instance_resource)
runner.instance_id = instance["Instances"][0]["InstanceId"]
instance = self.client.run_instances(**instance_resource) # type: ignore
runner.instance_id = instance["Instances"][0]["InstanceId"] # type: ignore
return runner

def delete(self, runner: Runner):
Expand Down

0 comments on commit a623a14

Please sign in to comment.