fence-agents/bz2211460-fence_azure-arm-2-metadata-endpoint-error-message.patch
Oyvind Albrigtsen acc7086b1d - fence_azure_arm: add Stack Hub support
Resolves: rhbz#2211460
2023-07-03 12:32:35 +02:00

33 lines
1.4 KiB
Diff

--- a/lib/azure_fence.py.py 2023-07-03 11:40:44.083882319 +0200
+++ b/lib/azure_fence.py.py 2023-07-03 11:40:38.178784811 +0200
@@ -317,12 +317,11 @@
from azure.mgmt.compute import ComputeManagementClient
cloud_environment = get_azure_cloud_environment(config)
+ if cloud_environment and config.Cloud.lower() == "stack" and not config.MetadataEndpoint:
+ fail_usage("metadata-endpoint not specified")
credentials = get_azure_credentials(config)
if cloud_environment:
- if (config.Cloud.lower() == "stack") and not config.MetadataEndpoint:
- fail_usage("metadata-endpoint not specified")
-
compute_client = ComputeManagementClient(
credentials,
config.SubscriptionId,
@@ -339,12 +338,11 @@
from azure.mgmt.network import NetworkManagementClient
cloud_environment = get_azure_cloud_environment(config)
+ if cloud_environment and config.Cloud.lower() == "stack" and not config.MetadataEndpoint:
+ fail_usage("metadata-endpoint not specified")
credentials = get_azure_credentials(config)
if cloud_environment:
- if (config.Cloud.lower() == "stack") and not config.MetadataEndpoint:
- fail_usage("metadata-endpoint not specified")
-
network_client = NetworkManagementClient(
credentials,
config.SubscriptionId,