From 8066770351ae98312b36512b19081d1abeb0804d Mon Sep 17 00:00:00 2001 From: "Kaihui (Kerwin) Sun" Date: Sun, 7 Feb 2021 14:38:45 +0800 Subject: [PATCH] fix versions in privatedns and frontdoor setups (#16588) --- sdk/network/azure-mgmt-frontdoor/setup.py | 4 +++- sdk/network/azure-mgmt-privatedns/setup.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sdk/network/azure-mgmt-frontdoor/setup.py b/sdk/network/azure-mgmt-frontdoor/setup.py index 2a3a36d9c429..3378256d91ef 100644 --- a/sdk/network/azure-mgmt-frontdoor/setup.py +++ b/sdk/network/azure-mgmt-frontdoor/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/network/azure-mgmt-privatedns/setup.py b/sdk/network/azure-mgmt-privatedns/setup.py index 07257146c961..ed8b38d9b7d6 100644 --- a/sdk/network/azure-mgmt-privatedns/setup.py +++ b/sdk/network/azure-mgmt-privatedns/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)