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

Updating switches data #160

Merged
merged 1 commit into from
Mar 15, 2018
Merged

Conversation

saulotoledo
Copy link
Member

@saulotoledo saulotoledo commented Jan 26, 2018

This PR updates the Switches table and adds the switch id to the hardwares table in order to allow us to parse physical infra switches.

@miq-bot miq-bot added the wip label Jan 26, 2018
@saulotoledo saulotoledo force-pushed the updating_switches_data branch 3 times, most recently from ab57ac5 to 78dd9df Compare January 30, 2018 17:46
@saulotoledo saulotoledo force-pushed the updating_switches_data branch 2 times, most recently from 4783b27 to afe45b4 Compare February 6, 2018 14:08
@saulotoledo saulotoledo changed the title [WIP] Updating switches data Updating switches data Feb 6, 2018
@saulotoledo saulotoledo changed the title Updating switches data [WIP] Updating switches data Feb 6, 2018
@saulotoledo saulotoledo changed the title [WIP] Updating switches data Updating switches data Feb 16, 2018
@miq-bot miq-bot removed the wip label Feb 16, 2018
@saulotoledo
Copy link
Member Author

@Fryguy, could you take a look at this PR?

@agrare
Copy link
Member

agrare commented Feb 28, 2018

@saulotoledo I think while we're at it we should add a :type to switches so that we can STI the Switch model

@saulotoledo
Copy link
Member Author

saulotoledo commented Mar 6, 2018

Hi @agrare. I was playing for some time with that before doing the change. I added the :type but the ActiveRecord is not proper saving it. Sounds like the refresher is using a generic class to save the hash, so that will not work. Doing some research I see that actually the type for physical servers is filled manually by the parser in order to do a workaround here. I can do the same, but I cannot assure that it will be filled for other providers. How do you think I should proceed?

@agrare
Copy link
Member

agrare commented Mar 6, 2018

@saulotoledo try adding NewWithTypeStiMixin to the switch model like e.g. https://github.com/ManageIQ/manageiq/blob/master/app/models/host.rb#L11

@saulotoledo saulotoledo changed the title Updating switches data [WIP] Updating switches data Mar 6, 2018
@miq-bot miq-bot added the wip label Mar 6, 2018
@saulotoledo saulotoledo force-pushed the updating_switches_data branch 2 times, most recently from 4f0eebf to 0c1fc0b Compare March 6, 2018 19:57
@saulotoledo saulotoledo changed the title [WIP] Updating switches data Updating switches data Mar 6, 2018
@miq-bot miq-bot removed the wip label Mar 6, 2018
@saulotoledo
Copy link
Member Author

@agrare, it is done. I also added a new migration to the guest_devices table. It is an information that we need to be able to discover the connected devices. Let me know what you think about.

@saulotoledo saulotoledo changed the title Updating switches data [WIP] Updating switches data Mar 8, 2018
@saulotoledo
Copy link
Member Author

I will add a property to store the switch's MAC addresses. I will remove the WIP prefix after the update.

@saulotoledo saulotoledo changed the title [WIP] Updating switches data Updating switches data Mar 9, 2018
@miq-bot miq-bot removed the wip label Mar 9, 2018
@saulotoledo
Copy link
Member Author

@agrare, @rodneyhbrown7, the mac_addresses column was added. The parser has also been updated.

@miq-bot
Copy link
Member

miq-bot commented Mar 15, 2018

Checked commit saulotoledo@4bc1eef 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. ⭐

@Fryguy Fryguy merged commit aacea9e into ManageIQ:master Mar 15, 2018
@Fryguy Fryguy added this to the Sprint 82 Ending Mar 26, 2018 milestone Mar 15, 2018
@Fryguy Fryguy added the schema label Mar 15, 2018
@Fryguy Fryguy self-assigned this Mar 15, 2018
kbrock added a commit to kbrock/manageiq-ui-classic that referenced this pull request Mar 17, 2022
No PhysicalStorage mention power_state. It is not defined in the
schema nor is it a virtual attribute.

Lenovo praser does parse this out but there is nowhere to put the value.
They did add the column to PhysicalServer and PhysicalSwitch, so I think
this was an oversight.

pr for switch: ManageIQ/manageiq-schema#160
pr for server: ManageIQ/manageiq-schema@8e95341

Lets add this field back in once it is in the database schema
kbrock added a commit to kbrock/manageiq-ui-classic that referenced this pull request Mar 18, 2022
No PhysicalStorage mention power_state. It is not defined in the
schema nor is it a virtual attribute.

Lenovo praser does parse this out but there is nowhere to put the value.
They did add the column to PhysicalServer and PhysicalSwitch, so I think
this was an oversight.

pr for switch: ManageIQ/manageiq-schema#160
pr for server: ManageIQ/manageiq-schema@8e95341

Lets add this field back in once it is in the database schema
kbrock added a commit to kbrock/manageiq-ui-classic that referenced this pull request Mar 24, 2022
No PhysicalStorage mention power_state. It is not defined in the
schema nor is it a virtual attribute.

Lenovo praser does parse this out but there is nowhere to put the value.
They did add the column to PhysicalServer and PhysicalSwitch, so I think
this was an oversight.

pr for switch: ManageIQ/manageiq-schema#160
pr for server: ManageIQ/manageiq-schema@8e95341

Lets add this field back in once it is in the database schema
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