Skip to content
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

Fixed InventoryCollection Vm and Template #17602

Merged
merged 2 commits into from Jun 20, 2018

Conversation

slemrmartin
Copy link
Contributor

@slemrmartin slemrmartin commented Jun 18, 2018

Default values name and location were missing

Issue: #17396

@slemrmartin
Copy link
Contributor Author

Cc @agrare

Weird that it doesn't cause problems in all previous tests except vmware.

Btw I finally figured out what means "builder_params" :) Can I rename method add_builder_params to add_default_values in some next PR?

@slemrmartin
Copy link
Contributor Author

@miq-bot add_label bug

Default values name and location were missing
@slemrmartin slemrmartin force-pushed the inventory-collection-builder-vms branch from 5f20f80 to b08991d Compare June 19, 2018 07:09
@agrare
Copy link
Member

agrare commented Jun 19, 2018

Btw I finally figured out what means "builder_params" :) Can I rename method add_builder_params to add_default_values in some next PR?

Completely agree, default values is a much better name

@agrare
Copy link
Member

agrare commented Jun 19, 2018

@slemrmartin why do we need default values for name and location? IMO the parser should not leave these blank.

@agrare agrare self-assigned this Jun 19, 2018
@slemrmartin
Copy link
Contributor Author

@agrare because you specify them to definitions in InventoryCollectionDefault and vmware specs fail without it

@agrare
Copy link
Member

agrare commented Jun 20, 2018

@slemrmartin hm okay let me check the vmware specs because I don't think this should be needed. I'd rather it fail to save if vendor or name isn't passed because that is a case that shouldn't happen.

@agrare
Copy link
Member

agrare commented Jun 20, 2018

Hey @slemrmartin I pushed a fix for this agrare/manageiq-providers-vmware@cbcea7e
Can you cherry-pick that into your branch for the VMware PR if it looks good to you?

@slemrmartin
Copy link
Contributor Author

@agrare it looks good, cherry-picked.
I'm not sure about vendor, from where I refactor it, probably from amazon/azure.
It's not in InventoryCollectionDefault in core, all amazon/azure and vmware specs seems ok without it.

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@agrare
Copy link
Member

agrare commented Jun 20, 2018

@slemrmartin yeah vendor can't be in the base defaults because it is provider dependent, here is where the list of vendors for vm_or_template is defined https://github.com/ManageIQ/manageiq/blob/master/app/models/vm_or_template.rb#L40-L53

I'd be fine if that was just in the parser since it just needs to be one or two places in the parser.

@slemrmartin slemrmartin force-pushed the inventory-collection-builder-vms branch from 7191a8e to 74fa4dc Compare June 20, 2018 08:37
@slemrmartin
Copy link
Contributor Author

I know, I derived it from persister
https://github.com/ManageIQ/manageiq/blob/master/app/models/manager_refresh/inventory_collection/builder/shared.rb#L34
It fits it except case sensitivity and xen

@miq-bot
Copy link
Member

miq-bot commented Jun 20, 2018

Checked commits slemrmartin/manageiq@b08991d~...74fa4dc with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 👍

@agrare agrare merged commit f539f46 into ManageIQ:master Jun 20, 2018
@agrare agrare added this to the Sprint 89 Ending Jul 2, 2018 milestone Jun 20, 2018
@agrare
Copy link
Member

agrare commented Jun 20, 2018

@slemrmartin in that case I'm not sure what you weren't sure about up here ☝️ #17602 (comment) haha

@slemrmartin
Copy link
Contributor Author

I'm sure about value, not sure about from where I get it for refactoring :)) but probably I moved provider-specific definitions of vendor from amazon and azure to core..but nevermind :)

@slemrmartin slemrmartin deleted the inventory-collection-builder-vms branch June 20, 2018 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants