Cherrypick misc Azure test fixes (#34713)

* Fix test case failure for Azure ACS module (#33623)

* fix azure acs test failure

* change acs location

(cherry picked from commit 8e20ae2de4)

* fix azure test case failure for function apps module (#33658)

(cherry picked from commit f8d7e477f0)

* Fix storage endpoint for Azure Stack (#33946)

* Fix storage endpoint for Azure Stack

https://github.com/Azure/msrestazure-for-python/issues/64

* corrected visual indentation

(cherry picked from commit 6643fe821e)

* Fix incorrect formatting call in azure module (#33561)

Fix corrects formatting call in azure_rm_resourcegroup_facts module.

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 6654d69569)
This commit is contained in:
Matt Davis 2018-01-10 13:27:52 -08:00 committed by GitHub
parent ef0b705c08
commit 79d1ba35ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 13 deletions

View file

@ -144,7 +144,7 @@ class AzureRMResourceGroupFacts(AzureRMModuleBase):
try:
response = self.rm_client.resource_groups.list()
except CloudError as exc:
self.fail("Failed to list all items - {1}".format(str(exc)))
self.fail("Failed to list all items - {0}".format(str(exc)))
results = []
for item in response:

View file

@ -699,12 +699,11 @@ class AzureRMVirtualMachine(AzureRMModuleBase):
self.storage_blob_name = self.name
if self.storage_account_name and not self.managed_disk_type:
self.get_storage_account(self.storage_account_name)
properties = self.get_storage_account(self.storage_account_name)
requested_vhd_uri = 'https://{0}.blob.{1}/{2}/{3}'.format(self.storage_account_name,
self._cloud_environment.suffixes.storage_endpoint,
self.storage_container_name,
self.storage_blob_name)
requested_vhd_uri = '{0}{1}/{2}'.format(properties.primary_endpoints.blob,
self.storage_container_name,
self.storage_blob_name)
disable_ssh_password = not self.ssh_password_enabled

View file

@ -2,11 +2,12 @@
azure_rm_acs:
name: "acsdcos{{ resource_group | hash('md5') | truncate(7, True, '') }}"
resource_group: "{{ resource_group }}"
location: eastus2
location: eastus
orchestration_platform: DCOS
master_profile:
- count: 1
dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(10, True, '') }}"
vm_size: Standard_A0
linux_profile:
- admin_username: azureuser
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com
@ -28,11 +29,12 @@
azure_rm_acs:
name: "acsdcos{{ resource_group | hash('md5') | truncate(7, True, '') }}"
resource_group: "{{ resource_group }}"
location: eastus2
location: eastus
orchestration_platform: DCOS
master_profile:
- count: 1
dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(10, True, '') }}"
vm_size: Standard_A0
linux_profile:
- admin_username: azureuser
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com
@ -54,12 +56,13 @@
azure_rm_acs:
name: "acsdcos{{ resource_group | hash('md5') | truncate(7, True, '') }}"
resource_group: "{{ resource_group }}"
location: eastus2
location: eastus
orchestration_platform: DCOS
state: absent
master_profile:
- count: 1
dns_prefix: "acsdcos{{ resource_group | hash('md5') | truncate(10, True, '') }}"
vm_size: Standard_A0
linux_profile:
- admin_username: azureuser
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com
@ -74,11 +77,12 @@
azure_rm_acs:
name: "acssw{{ resource_group | hash('md5') | truncate(7, True, '') }}"
resource_group: "{{ resource_group }}"
location: eastus2
location: eastus
orchestration_platform: Swarm
master_profile:
- count: 1
dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(10, True, '') }}"
vm_size: Standard_A0
linux_profile:
- admin_username: azureuser
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com
@ -100,11 +104,12 @@
azure_rm_acs:
name: "acssw{{ resource_group | hash('md5') | truncate(7, True, '') }}"
resource_group: "{{ resource_group }}"
location: eastus2
location: eastus
orchestration_platform: Swarm
master_profile:
- count: 1
dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(10, True, '') }}"
vm_size: Standard_A0
linux_profile:
- admin_username: azureuser
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com
@ -126,12 +131,13 @@
azure_rm_acs:
name: "acssw{{ resource_group | hash('md5') | truncate(7, True, '') }}"
resource_group: "{{ resource_group }}"
location: eastus2
location: eastus
orchestration_platform: Swarm
state: absent
master_profile:
- count: 1
dns_prefix: "acssw{{ resource_group | hash('md5') | truncate(10, True, '') }}"
vm_size: Standard_A0
linux_profile:
- admin_username: azureuser
ssh_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqaZoyiz1qbdOQ8xEf6uEu1cCwYowo5FHtsBhqLoDnnp7KUTEBN+io238wdhjkasndq238e2/983289dasjnasey823/YkUCuzxDpsH7DUDhZcwySLKVVe0Qm3+928dfsjsejk298r/+vAnflKebuypNlmocIvakFWoZda18FOmsOoIVXQ8HWFNCuw9ZCunMSN62QGamCe3dL5cXlkgHYv7ekJE15IA9aOJcM7e90oeTqo+dsajda82e78sdja/llas8tsXY85LFqRnr3gJ02bAscjc477+X+j/gkpFoN1QEmt juliens@msft.com

View file

@ -19,10 +19,13 @@
azure_rm_functionapp_facts:
resource_group: '{{ resource_group }}'
name: azfuncci
register: results
- name: assert the facts were retrieved
assert:
that: '{{ ansible_facts.azure_functionapps|length == 1 }}'
that:
- results.ansible_facts.azure_functionapps|length == 1
- results.ansible_facts.azure_functionapps[0].name == 'azfuncci'
- name: delete basic function app
azure_rm_functionapp: