-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collect customization_specs #614
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,20 @@ def parse_compute_resource(object, kind, props) | |
end | ||
alias parse_cluster_compute_resource parse_compute_resource | ||
|
||
def parse_customization_spec_manager(_object, kind, props) | ||
return if kind == "leave" | ||
|
||
props[:info].to_a.each do |spec_info| | ||
persister.customization_specs.build( | ||
:name => spec_info[:name], | ||
:typ => spec_info[:type], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be :type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Here is the database table definition: https://github.com/ManageIQ/manageiq-schema/blob/master/db/migrate/20130923182042_collapsed_initial_migration.rb#L303 |
||
:description => spec_info[:description], | ||
:last_update_time => spec_info[:last_update_time].to_s, | ||
:spec => rbvmomi_to_basic_types(spec_info[:spec]).deep_stringify_keys | ||
) | ||
end | ||
end | ||
|
||
def parse_datacenter(object, kind, props) | ||
persister.ems_folders.targeted_scope << object._ref | ||
return if kind == "leave" | ||
|
@@ -393,4 +407,15 @@ def lazy_find_managed_object(managed_object) | |
parent_collection = persister.vim_class_to_collection(managed_object) | ||
parent_collection.lazy_find(managed_object._ref) | ||
end | ||
|
||
def rbvmomi_to_basic_types(obj) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we could just do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My change for this actually got merged but hasn't been released yet, I'll update this when a release is cut |
||
case obj | ||
when RbVmomi::BasicTypes::DataObject | ||
obj.props.transform_values { |v| rbvmomi_to_basic_types(v) } | ||
when Array | ||
obj.map { |v| rbvmomi_to_basic_types(v) } | ||
else | ||
obj | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,3 +162,5 @@ | |
- licenses | ||
:ExtensionManager: | ||
- extensionList | ||
:CustomizationSpecManager: | ||
- info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the failure occur in the middle of the loop, does this move on or end the loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also ewww N+1...There's no way to bulk ask this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would move on to the next one not skip, and no unfortunately not you can't get multiple customization scripts at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done here previously, the other option is to get the full spec at provision time which is closer to what the vsphere client does