Created
April 10, 2019 12:38
-
-
Save dLobatog/866c349ff4a262473fac7f883a030d72 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Host.all.map do |host| | |
| inventory_host = HostInventoryAPI.new(host, Account.find("9f6f30ee-dd69-42e6-bfc0-374e85e3cdc7"), Settings.host_inventory_url, b64identity).host_already_in_inventory | |
| if inventory_host | |
| old_id = host.id | |
| host.update(id: inventory_host.id) | |
| ProfileHost.where(host_id: old_id).update_all(host_id: inventory_host.id) | |
| RuleResult.where(host_id: old_id).update_all(host_id: inventory_host.id) | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment