@@ -67,6 +67,7 @@ def __init__(
6767 self .private_ip_action = "CREATE_NEW"
6868 self .security_group_id : str = self .config .active_config .get ("security_group_id" , "" )
6969 self .target_machines : List [str ] = self .config .active_config .get ("machines" , "" ).split ("," )
70+ self .target_machines = [x .upper () for x in self .target_machines ]
7071 self .target_instance_types : List [str ] = self .config .active_config .get ("instance_types" , "" ).split ("," )
7172 if len (self .target_machines ) == len (self .target_instance_types ):
7273 self .target_instances : Dict [str , str ] = dict (zip (self .target_machines , self .target_instance_types ))
@@ -345,9 +346,7 @@ def check(self) -> bool:
345346 for machine in json .loads (machines_response .text ).get ("items" , []):
346347 source_props : Dict [str , Any ] = machine .get ("sourceProperties" , {})
347348 ref_name : str = source_props .get ("name" ) or source_props .get ("machineCloudId" , "NONE" )
348- if _machine == source_props .get ("name" , "NONE" ) or _machine == source_props .get (
349- "machineCloudId" , "NONE"
350- ):
349+ if ref_name .upper () == _machine :
351350 machine_exist = True
352351
353352 if "lastConsistencyDateTime" not in machine ["replicationInfo" ]:
@@ -456,8 +455,8 @@ def update_blueprint(self) -> bool:
456455 for machine in json .loads (machines_response .text ).get ("items" , []):
457456 source_props : Dict [str , Any ] = machine .get ("sourceProperties" , {})
458457 machine_id : str = machine .get ("id" )
459- machine_name : str = source_props .get ("name" )
460- if machine_name in self .target_machines or machine_name . upper () in self . target_machines :
458+ machine_name : str = source_props .get ("name" , "" ). upper ( )
459+ if machine_name in self .target_machines :
461460 machine_data_dict [machine_id ] = machine_name
462461
463462 if not machine_data_dict :
0 commit comments