Skip to content

Commit

Permalink
Merge pull request ManageIQ#11587 from djberg96/azure_refresh_parser
Browse files Browse the repository at this point in the history
Skip over private image collection for Azure on failure
  • Loading branch information
blomquisg committed Oct 5, 2016
2 parents b93de73 + a6d7a98 commit a1c1ec0
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,15 @@ def get_instances
process_collection(instances, :vms) { |instance| parse_instance(instance) }
end

# The underlying method that gathers these images is a bit brittle.
# Consequently, if it raises an error we just log it and move on so
# that it doesn't affect the rest of inventory collection.
#
def get_images
images = gather_data_for_this_region(@sas, 'list_all_private_images')
rescue Azure::Armrest::ApiException => err
_log.warn("Unable to collect Azure private images for: [#{@ems.name}] - [#{@ems.id}]: #{err.message}")
else
process_collection(images, :vms) { |image| parse_image(image) }
end

Expand Down

0 comments on commit a1c1ec0

Please sign in to comment.