Skip to content

Commit

Permalink
Merge pull request #135 from nenioscio/master
Browse files Browse the repository at this point in the history
Fix for broken 'resource_actions' on button import
  • Loading branch information
branic authored Oct 6, 2018
2 parents ba1b34f + 8bdab4d commit 1404fca
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions rhconsulting_buttons.rake
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,12 @@ class ButtonsImportExport
# end
# count += 1
#end
resource_action = ResourceAction.new
all_ra = ResourceAction.in_region(MiqRegion.my_region_number)
all_ra.each do |find_action|
# puts "checking ra: #{find_action['id']} if it has resource_id of #{find_action['resource_id']}"
if find_action['resource_id'] == custom_button.id
# puts "FOUND: #{find_action.inspect}"
resource_action = find_action
resource_action.reload
end
end
resource_action = ResourceAction.in_region(MiqRegion.my_region_number).find_or_create_by(
resource_id: custom_button.id, resource_type: 'CustomButton')

#puts "ResourceActions PRE: #{resource_action.inspect}"
ra = {}
ra['action'] = resource_actions['action']
ra['resource_id'] = custom_button.id
ra['resource_type'] = "CustomButton"
ra['ae_namespace'] = resource_actions['ae_namespace']
ra['ae_class'] = resource_actions['ae_class']
ra['ae_instance'] = resource_actions['ae_instance']
Expand Down

0 comments on commit 1404fca

Please sign in to comment.