From 57921c0b4d474413ed389862b8b50e8dddf6f2a7 Mon Sep 17 00:00:00 2001 From: h-hirokawa Date: Wed, 13 Jul 2016 16:13:27 +0900 Subject: [PATCH] Fix azure_rm_virtualmachine (#4174). --- lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py index 8346381abd9..9da0639a1e6 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py @@ -1142,9 +1142,10 @@ class AzureRMVirtualMachine(AzureRMModuleBase): valid_name = False # Attempt to find a valid storage account name + storage_account_name_base = self.name[:20].lower() for i in range(0, 5): rand = random.randrange(1000, 9999) - storage_account_name = self.name[:20] + str(rand) + storage_account_name = storage_account_name_base + str(rand) if self.check_storage_account_name(storage_account_name): valid_name = True break