Skip to content

Commit

Permalink
Add an inventory_collection for the EMS
Browse files Browse the repository at this point in the history
There are some attributes that need to be updated on the EMS record by
the parser.  For graph refresh this is currently done by directly doing
an ems.update_attributes! in the parser which breaks our "parser
shouldn't connect to the DB" rule.

This adds an inventory collection which allows the parser to set
properties to be saved on the ext_management_system record.
  • Loading branch information
agrare committed Feb 25, 2019
1 parent cb18388 commit 27131db
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ def vendor
'unknown'
end

def ext_management_system
add_properties(
:manager_ref => %i(guid),
:custom_save_block => lambda do |ems, inventory_collection|
ems_attrs = inventory_collection.data.first&.attributes
ems.update_attributes!(ems_attrs) if ems_attrs
end
)
end

def vms
vm_template_shared
end
Expand Down

0 comments on commit 27131db

Please sign in to comment.