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

Fixes #13248 - rely on foreman fact importer to import interfaces #5713

Merged
merged 1 commit into from
Jan 21, 2016

Conversation

jlsherrill
Copy link
Member

This fixes a variety of issues around registration, including:

  • Registering fedora 20 (and possibly newer) machines
  • proper selection of a primary interface
  • proper detection of bringed and virt interfaces
  • No longer creates an empty primary interface on host creation

end

# rubocop:disable Style/AccessorMethodName:
def get_interfaces
Copy link
Member Author

Choose a reason for hiding this comment

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

overrides the base model

@@ -245,7 +243,7 @@ def server_status
def facts
User.as_anonymous_admin do
sync_task(::Actions::Katello::Host::Update, @host, rhsm_params)
@host.subscription_facet.update_facts(rhsm_params[:facts]) unless rhsm_params[:facts].blank?
Katello::Host::SubscriptionFacet.update_facts(@host, rhsm_params[:facts])
Copy link
Member

Choose a reason for hiding this comment

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

Are we not assured the host has a subscription facet here?

Copy link
Member Author

Choose a reason for hiding this comment

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

we are in the find_host method

Copy link
Member

Choose a reason for hiding this comment

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

I don't see why we'd call a class method to then call methods on the object instead of having an instance method on subscription_facet like the original line had?

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason is because facts have to be imported before the host is created. Maybe is hould move this to the RhsmFactImporter class ? Probably makes more sense there if its not on an instance

Copy link
Member

Choose a reason for hiding this comment

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

I am confused -- if you have @host here, how is it not "created" ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

In the code you linked, where is the host created? At the save (https://github.com/Katello/katello/pull/5713/files#diff-50713e26c68a3af05393d936d0f19328R25) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually is it saved to the db as part of the fact import, if any error occurs within the plan() phase, it rolls it all back.

@ehelms
Copy link
Member

ehelms commented Jan 18, 2016

To test this, I need a VM without an IP address? Or do you have another verification scenario?

@jlsherrill
Copy link
Member Author

@ehelms to test one of the possibly failure conditions yes, you need a box that has at least one interface without an ipadress. So a VM with an extra nic that isn't configured, or a desktop with a wireless interface that is disabled, anything like that.

This fixes a variety of issues around registration, including:

* Registering fedora 20 (and possibly newer) machines
* proper selection of a primary interface
* proper detection of bringed and virt interfaces
* No longer creates an empty primary interface on host creation
@jlsherrill
Copy link
Member Author

@ehelms any more thoughts on this?

@ehelms
Copy link
Member

ehelms commented Jan 21, 2016

ACK

jlsherrill added a commit that referenced this pull request Jan 21, 2016
Fixes #13248 - rely on foreman fact importer to import interfaces
@jlsherrill jlsherrill merged commit 7c4a39b into Katello:master Jan 21, 2016
@jlsherrill jlsherrill deleted the 13248 branch January 21, 2016 13:44
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.

3 participants