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

Inventory Enterprise (Nuage) into CloudTenant (MIQ) #92

Merged
merged 1 commit into from
May 29, 2018

Conversation

miha-plesko
Copy link
Contributor

@miha-plesko miha-plesko commented May 28, 2018

With this commit we inventory Enterprise into CloudTenant model instead into NetworkGroup model. We capture its name and description and hook it to the network manager.

Followup PR on UI: ManageIQ/manageiq-ui-classic#3995

RFE BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1574903

@Ladas with this commit we stop using NetworkGroup and use CloudTenant instead. We promised such change long time ago and here we are. This commit seems large but what it does in fact is a find-and-replace

"network_group" -> "cloud_tenant"

and nothing more. Most of the files are in fact specs...

@miha-plesko miha-plesko requested a review from Ladas May 28, 2018 06:44
@miha-plesko miha-plesko force-pushed the inventory-enterprises branch 2 times, most recently from 06b6a08 to 469a672 Compare May 28, 2018 07:05
@Ladas
Copy link
Contributor

Ladas commented May 28, 2018

@miha-plesko interesting, I think NetworkGroup was originally designed to replace CloudNetwork model. We did a new model, because it was a bit different. Does CloudTenant fit this better?

@miha-plesko
Copy link
Contributor Author

@Ladas I'm pretty sure, yes. See here how Enterprise object looks like: https://nuagenetworks.github.io/vsd-api-documentation/v5_0/enterprise.html - it's more like a "project" i.e. "tenant" i.e. "scope" than a network entity, because it has no networking properties like CIDR.

We had a discussion with @gtanzillo , @Fryguy and @gberginc about this and I think CloudTenant seems the most reasonable choice here. Looking forward to your opinion though.

def network_group(ems_ref)
network_groups.find { |ng| ng['ID'] == ems_ref }
def cloud_tenant(ems_ref)
cloud_tenants.find { |tenant| tenant['ID'] == ems_ref }
Copy link
Contributor

Choose a reason for hiding this comment

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

we could cache it like in target_collection.rb, so we don't do repeated O(n) searches

Copy link
Contributor

@Ladas Ladas left a comment

Choose a reason for hiding this comment

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

1 nit, otherwise it looks great 👍

@miha-plesko if it's more like a project, then yeah CloudTenant is better fit. (NetworkGroup will not be used anymore, so we can probably drop it)

With this commit we inventory Enterprise into CloudTenant model
instead into NetworkGroup model. We capture its name and description
and hook it to the network manager.

RFE BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1574903

Signed-off-by: Miha Pleško <[email protected]>
@miha-plesko miha-plesko force-pushed the inventory-enterprises branch from 469a672 to 94390e6 Compare May 28, 2018 12:41
@miha-plesko
Copy link
Contributor Author

Thanks for suggesting the caching improvement, I've updated the code. I can prepare a PR in core to remove NetworkGroup completely @Ladas if you're sure no other provider uses it.

@miq-bot
Copy link
Member

miq-bot commented May 28, 2018

Checked commit miha-plesko@94390e6 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
15 files checked, 0 offenses detected
Everything looks fine. 🍪

@Ladas
Copy link
Contributor

Ladas commented May 28, 2018

@miha-plesko I am 98% sure no other provider uses NetworkGroup :-) We've created it just for Nuage and the work for using it further was never finished.

@miha-plesko
Copy link
Contributor Author

@Ladas OK I'll remove it then. Are you good with this PR now? We want to further expand inventory and need this one merged to continue.

Copy link
Contributor

@Ladas Ladas left a comment

Choose a reason for hiding this comment

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

Yes, it looks great now. 👍

@Ladas Ladas self-assigned this May 29, 2018
@Ladas Ladas merged commit 2323071 into ManageIQ:master May 29, 2018
@Ladas Ladas added this to the Sprint 87 Ending Jun 4, 2018 milestone May 29, 2018
@miha-plesko miha-plesko deleted the inventory-enterprises branch July 24, 2018 08:47
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