@@ -703,9 +703,10 @@ def take_action(self, parsed_args: argparse.Namespace) -> None:
703703 errors = 0
704704 for security_group in security_groups :
705705 try :
706+ # SDK wants a SecurityGroup object but will handle a dict
706707 compute_client .add_security_group_to_server (
707708 server ,
708- {'name' : security_group },
709+ {'name' : security_group }, # type: ignore[arg-type]
709710 )
710711 except sdk_exceptions .HttpException as e :
711712 errors += 1
@@ -4214,9 +4215,10 @@ def take_action(self, parsed_args: argparse.Namespace) -> None:
42144215 errors = 0
42154216 for security_group in security_groups :
42164217 try :
4218+ # SDK wants a SecurityGroup object but will handle a dict
42174219 compute_client .remove_security_group_from_server (
42184220 server ,
4219- {'name' : security_group },
4221+ {'name' : security_group }, # type: ignore[arg-type]
42204222 )
42214223 except sdk_exceptions .HttpException as e :
42224224 errors += 1
@@ -4320,17 +4322,17 @@ def take_action(self, parsed_args: argparse.Namespace) -> None:
43204322 compute_client = self .app .client_manager .compute
43214323 image_client = self .app .client_manager .image
43224324
4323- image_ref = None
4325+ image = None
43244326 if parsed_args .image :
4325- image_ref = image_client .find_image (
4327+ image = image_client .find_image (
43264328 parsed_args .image , ignore_missing = False
43274329 ).id
43284330
43294331 server = compute_client .find_server (
43304332 parsed_args .server , ignore_missing = False
43314333 )
43324334 compute_client .rescue_server (
4333- server , admin_pass = parsed_args .password , image_ref = image_ref
4335+ server , admin_pass = parsed_args .password , image = image
43344336 )
43354337
43364338
0 commit comments