logging.debug("{get_fence_subnet_for_config} testing virtual network %s in resource group %s for a fence subnet"%(subnetResource.ResourceName,subnetResource.ResourceGroupName))
logging.info("{test_fence_subnet} Network Securiy Group %s of fence subnet %s has no outbound security rule that blocks all traffic"%(nsgResource.ResourceName,fenceSubnet.id))
elifnotinboundRule:
testOk=False
logging.info("{test_fence_subnet} Network Securiy Group %s of fence subnet %s has no inbound security rule that blocks all traffic"%(nsgResource.ResourceName,fenceSubnet.id))
logging.info("{get_network_state} IP configuration %s is not in fence subnet (ip subnet: %s, fence subnet: %s)"%(ipConfig.name,ipConfig.subnet.id.lower(),fenceSubnet.id.lower()))
allNICOK=False
ifallNICOK:
logging.info("{get_network_state} All IP configurations of all network interfaces are in the fence subnet. Declaring VM as off")
fail_usage("{set_network_state} subnet %s not found"%subnetId)
ipConfig.subnet=oldSubnet
ipConfig.private_ip_allocation_method=ipType
ifipAddress:
ipConfig.private_ip_address=ipAddress
else:
fail_usage("{set_network_state} IP configuration %s is missing the required resource tags(subnetId: %s, ipType: %s, ipAddress: %s)"%(ipConfig.name,subnetId,ipType,ipAddress))
logging.info("{set_network_state} updating nic %s"%(nic.id))