@@ -731,13 +731,12 @@ def process_target_fabric(cmd,
731731 amh_solution ):
732732 # Get source fabric agent (DRA)
733733 source_fabric_name = source_fabric .get ('name' )
734- dras_uri = (
734+ source_dras = send_get_request (
735+ cmd ,
735736 f"{ rg_uri } /providers/Microsoft.DataReplication"
736737 f"/replicationFabrics/{ source_fabric_name } /fabricAgents"
737738 f"?api-version={ APIVersion .Microsoft_DataReplication .value } "
738- )
739- source_dras_response = send_get_request (cmd , dras_uri )
740- source_dras = source_dras_response .json ().get ('value' , [])
739+ ).json ().get ('value' , [])
741740
742741 source_dra = None
743742 source_found_not_responsive = None
@@ -750,8 +749,7 @@ def process_target_fabric(cmd,
750749 if bool (props .get ('isResponsive' )):
751750 source_dra = dra
752751 break
753- else :
754- source_found_not_responsive = dra
752+ source_found_not_responsive = dra
755753
756754 if not source_dra and source_found_not_responsive :
757755 nr_props = source_found_not_responsive .get ('properties' , {})
@@ -791,13 +789,12 @@ def process_target_fabric(cmd,
791789
792790 # Get target fabric agent (DRA)
793791 target_fabric_name = target_fabric .get ('name' )
794- target_dras_uri = (
792+ target_dras = send_get_request (
793+ cmd ,
795794 f"{ rg_uri } /providers/Microsoft.DataReplication"
796795 f"/replicationFabrics/{ target_fabric_name } /fabricAgents"
797796 f"?api-version={ APIVersion .Microsoft_DataReplication .value } "
798- )
799- target_dras_response = send_get_request (cmd , target_dras_uri )
800- target_dras = target_dras_response .json ().get ('value' , [])
797+ ).json ().get ('value' , [])
801798
802799 target_dra = None
803800 target_found_not_responsive = None
@@ -811,8 +808,7 @@ def process_target_fabric(cmd,
811808 if bool (props .get ('isResponsive' )):
812809 target_dra = dra
813810 break
814- else :
815- target_found_not_responsive = dra
811+ target_found_not_responsive = dra
816812
817813 if not target_dra and target_found_not_responsive :
818814 nr_props = target_found_not_responsive .get ('properties' , {})
0 commit comments