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

Save Physical Storage Model #17380

Merged
merged 1 commit into from
Jun 4, 2018
Merged

Conversation

EsdrasVP
Copy link
Member

@EsdrasVP EsdrasVP commented May 3, 2018

This PR is able to save physical storage model into ManageIQ. Likewise Switches, Servers, Racks and Chassis, the Storage is a physical component, which is why I labeled it PhysicalStorage in model.

Depends on:

@miq-bot miq-bot added the wip label May 3, 2018
@EsdrasVP EsdrasVP force-pushed the save_physical_storage branch 3 times, most recently from 127620a to 642fa3a Compare May 8, 2018 16:56
@EsdrasVP EsdrasVP changed the title [WIP] Save Physical Storage Model Save Physical Storage Model May 11, 2018
@miq-bot miq-bot removed the wip label May 11, 2018
@miq-bot
Copy link
Member

miq-bot commented May 22, 2018

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented May 30, 2018

This pull request is not mergeable. Please rebase and repush.

@EsdrasVP EsdrasVP force-pushed the save_physical_storage branch 2 times, most recently from 6bc0e38 to f96e152 Compare May 31, 2018 14:46
@Fryguy
Copy link
Member

Fryguy commented May 31, 2018

LGTM @agrare Please review. Note that there are no specs going through this yet, otherwise this would fail since I just merged the database change. I expect that the provider refresh will ultimately test this.

@agrare
Copy link
Member

agrare commented Jun 1, 2018

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.

Looks like you're missing an association
I also get errors when trying to run with your lenovo PR and this applied:

NameError:
  uninitialized constant XClarityClient::Storage

Is there a gem change also needed?

@@ -0,0 +1,9 @@
class PhysicalStorage < ApplicationRecord
belongs_to :ext_management_system, :foreign_key => :ems_id, :inverse_of => :physical_storages
Copy link
Member

Choose a reason for hiding this comment

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

You need to add the physical_storages association to ext_management_system for this to work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just fixed it to following what was done in ManageIQ/manageiq#17423. Now Physical Infra Manager have many physical_storages.

end

child_keys = %i(computer_system asset_detail)
save_inventory_multi(ems.physical_storages, hashes, deletes, [:ems_ref], child_keys)
Copy link
Member

Choose a reason for hiding this comment

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

Same here there is no ems.physical_storages yet

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed it, now it should work.

@EsdrasVP EsdrasVP force-pushed the save_physical_storage branch from f96e152 to 73dc83e Compare June 4, 2018 18:13
@miq-bot
Copy link
Member

miq-bot commented Jun 4, 2018

Checked commit EsdrasVP@dd555a9 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 0 offenses detected
Everything looks fine. 🏆

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.

I'm still having issues with ManageIQ/manageiq-providers-lenovo#170 but they look like they are specific to that PR. The save_inventory part of this looks good and I tested the associations and they work as expected.

@agrare agrare merged commit b861896 into ManageIQ:master Jun 4, 2018
@agrare agrare added this to the Sprint 87 Ending Jun 4, 2018 milestone Jun 4, 2018
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.

4 participants