diff --git a/sdk/compute/azure-mgmt-compute/setup.py b/sdk/compute/azure-mgmt-compute/setup.py index f150346e03de..9c66a4d27b46 100644 --- a/sdk/compute/azure-mgmt-compute/setup.py +++ b/sdk/compute/azure-mgmt-compute/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) diff --git a/sdk/compute/azure-mgmt-compute/tests/test_cli_mgmt_compute.py b/sdk/compute/azure-mgmt-compute/tests/test_cli_mgmt_compute.py index 87031b00616b..1eedd415af9d 100644 --- a/sdk/compute/azure-mgmt-compute/tests/test_cli_mgmt_compute.py +++ b/sdk/compute/azure-mgmt-compute/tests/test_cli_mgmt_compute.py @@ -187,10 +187,13 @@ def test_compute(self, resource_group): INSTANCE_IDS = ["1"] LOG_ANALYTIC_NAME = "loganalytic" - - SUBNET = self.create_virtual_network(RESOURCE_GROUP, AZURE_LOCATION, NETWORK_NAME, SUBNET_NAME) - NIC_ID = self.create_network_interface(RESOURCE_GROUP, AZURE_LOCATION, INTERFACE_NAME, SUBNET) - # VAULT_ID, VAULT_URL, KEY_NAME = self.create_key(RESOURCE_GROUP, AZURE_LOCATION, KEY_VAULT, TENANT_ID) + if self.is_live: + SUBNET = self.create_virtual_network(RESOURCE_GROUP, AZURE_LOCATION, NETWORK_NAME, SUBNET_NAME) + NIC_ID = self.create_network_interface(RESOURCE_GROUP, AZURE_LOCATION, INTERFACE_NAME, SUBNET) + # VAULT_ID, VAULT_URL, KEY_NAME = self.create_key(RESOURCE_GROUP, AZURE_LOCATION, KEY_VAULT, TENANT_ID) + else: + SUBNET = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/" + RESOURCE_GROUP + "/providers/Microsoft.Network/virtualNetworks/" + NETWORK_NAME + "/subnets/" + SUBNET_NAME + NIC_ID = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/" + RESOURCE_GROUP + "/providers/Microsoft.Network/networkInterfaces/" + INTERFACE_NAME # Create an empty managed disk.[put] BODY = { diff --git a/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute.py b/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute.py index af119a83eae0..5b69f0c1c63c 100644 --- a/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute.py +++ b/sdk/compute/azure-mgmt-compute/tests/test_mgmt_compute.py @@ -5,6 +5,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- + import unittest from collections import namedtuple