Description of problem: I can successfully create an Azure provider is successfully created, however during an EMS Refresh the refresh process encounters an error. Below is the error and beginning of the stack trace. [----] E, [2016-08-17T15:19:26.230101 #60252:c7d990] ERROR -- : MIQ(ManageIQ::Providers::Azure::CloudManager::Refresher#refresh) EMS: [Azure], id: [1000000000011] Refresh failed [----] E, [2016-08-17T15:19:26.267193 #60252:c7d990] ERROR -- : [NameError]: undefined local variable or method `resource' for #<ManageIQ::Providers::Azure::CloudManager::RefreshParser:0x00000005125a20> Method:[rescue in block in refresh] [----] E, [2016-08-17T15:19:26.267261 #60252:c7d990] ERROR -- : /var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:131:in `transfer_selected_resource_properties' /var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:121:in `block in resource_already_collected?' /var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:116:in `each' /var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:116:in `each_with_index' /var/www/miq/vmdb/app/models/manageiq/providers/azure/cloud_manager/refresh_parser.rb:116:in `resource_already_collected?' << CLIPPED >> The code block being executed is: def transfer_selected_resource_properties(old_resource, new_resource) if new_resource.properties.provisioning_state != 'Succeeded' old_resource.properties.provisioning_state = resource.properties.provisioning_state end if new_resource.properties.try(:status_message) if old_resource.properties.try(:status_message) old_resource.properties.status_message += "\n#{new_resource.properties.status_message}" else old_resource.properties['status_message'] = new_resource.properties.status_message end end end There is a resource that has a provisioning state that is not Successful and therefore CloudForms attempts to set properties of the old_resource variable from the variable named resource, but there is no variable named "resource" in the current scope. Based on how the function is being called from the resource_already_collected? function (line 123) I believe the variable named resource should really be named new_resource. Modified code block: def transfer_selected_resource_properties(old_resource, new_resource) if new_resource.properties.provisioning_state != 'Succeeded' old_resource.properties.provisioning_state = new_resource.properties.provisioning_state end if new_resource.properties.try(:status_message) if old_resource.properties.try(:status_message) old_resource.properties.status_message += "\n#{new_resource.properties.status_message}" else old_resource.properties['status_message'] = new_resource.properties.status_message end end end Version-Release number of selected component (if applicable): cfme-5.6.0.13 How reproducible: requires this Azure account
https://github.com/ManageIQ/manageiq/pull/10614
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/6b9d0716c90129a66757b4d9de4768d7a5ea50c1 commit 6b9d0716c90129a66757b4d9de4768d7a5ea50c1 Author: Bill Wei <bilwei> AuthorDate: Thu Aug 18 15:47:29 2016 -0400 Commit: Bill Wei <bilwei> CommitDate: Fri Aug 19 14:30:30 2016 -0400 Fix a typo: resource -> new_resource Fix how to acculate resource status messages. https://bugzilla.redhat.com/show_bug.cgi?id=1368239 .../azure/cloud_manager/refresh_parser.rb | 31 +++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-)
Test case is assumed for refresh errors.
Verified via code review. It really isn't possible to create a bad resource on purpose in Azure. So far I haven't seen any new refresh errors.