Project

General

Profile

Bug #15725

virt-who checkin should use default org view and should not overwrite existing registration

Added by Justin Sherrill almost 3 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Category:
Candlepin
Target version:
Difficulty:
medium
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Right now virt-who checkin's still register the host to a specific content view and lifecycle environment, but the create host has no content facet. This is incorrect and should just use the default org view and library


Related issues

Blocks Katello - Tracker #15825: Sprint 1 : Content-FocusedNew2016-07-24

Associated revisions

Revision 6a9661b5 (diff)
Added by Justin Sherrill almost 3 years ago

Fixes #15725 - fixing cv/env and register overwritting (#6235)

This fixes one minor issue and one major issue:

  • When registering via virt-who we should not be registering
    with the passed in Environment and Content view. This is
    because no Content facet exists. In fact candlepin seems to
    completely ignore this parameter and does not save environment
    for hypervisors
  • When registering using ESX or a libvirt remote connection, if
    the virt-who host is already registered, the registration will be
    overwritten/lost and the host's registration will be useless

History

#1 Updated by Justin Sherrill almost 3 years ago

to correct this, simply use:

foreman-rake console


User.current = User.first

Katello::Hypervisor.all.each do |hypervisor|
    org = hypervisor.environment.organization
    hypervisor.content_view = org.default_content_view
    hypervisor.environment = org.library
    hypervisor.save!

    candlepin_environment_id =  org.default_content_view.content_view_environments.first.cp_id
    ::Katello::Resources::Candlepin::Consumer.update(hypervisor.uuid, {'environment' => {'id' => candlepin_environment_id}})
end

#2 Updated by Justin Sherrill almost 3 years ago

  • Bugzilla link set to 1357878

#3 Updated by Brad Buckingham almost 3 years ago

#4 Updated by Justin Sherrill almost 3 years ago

  • Category set to Candlepin
  • Status changed from New to Assigned
  • Assignee set to Justin Sherrill
  • Legacy Backlogs Release (now unused) set to 162
  • Difficulty set to medium

#5 Updated by Justin Sherrill almost 3 years ago

  • Subject changed from virt-who checkin should use default org view unless the hypervisor is registered to virt-who checkin should use default org view and should not overwrite existing registration

#6 Updated by The Foreman Bot almost 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6235 added

#7 Updated by Justin Sherrill almost 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF