Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1170696 - hammer host enable build can be enable also for unmanaged hosts
Summary: hammer host enable build can be enable also for unmanaged hosts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: Unspecified
Assignee: Adam Ruzicka
QA Contact: Stephen Benjamin
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2014-12-04 15:53 UTC by Peter Vreman
Modified: 2019-09-26 17:39 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:38:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 8587 0 None None None 2016-04-22 16:43:28 UTC

Description Peter Vreman 2014-12-04 15:53:42 UTC
Description of problem:
It is possible to enable build also for hosts that are not managed. The result is then a no-op, because the PXE templates are not generated.

This behaviour is inconsistent with the UI, that where you cannot click the Build button when the host is not Managed. Also in the situation of enabling build without managed shows in the UI that the node is in Building status, but you are not allowed to view the templates either, these show an error that the host is not managed.


hoiroot@li-lc-1017:~$ sudo -u hoici hammer -c /opt/hoici/etc/hammer-hoici.yaml host update --name li-lc-1014.hag.hilti.com --managed no
Host updated

hoiroot@li-lc-1017:~$ ls -l /var/lib/tftpboot/pxelinux.cfg/
total 16
-rw-r--r-- 1 foreman-proxy foreman-proxy 12361 Dec  4 15:22 default

hoiroot@li-lc-1017:~$ sudo -u hoici hammer -c /opt/hoici/etc/hammer-hoici.yaml host update --name li-lc-1014.hag.hilti.com --build no
Host updated

hoiroot@li-lc-1017:~$ sudo -u hoici hammer -c /opt/hoici/etc/hammer-hoici.yaml host update --name li-lc-1014.hag.hilti.com --build yes
Host updated

hoiroot@li-lc-1017:~$ ls -l /var/lib/tftpboot/pxelinux.cfg/
total 16
-rw-r--r-- 1 foreman-proxy foreman-proxy 12361 Dec  4 15:22 default


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Use the hammer to enable build as shown above
2.
3.

Actual results:


Expected results:
Give an Error that enabling build is only allowed for Managed hosts.


Additional info:

Comment 1 RHEL Program Management 2014-12-04 16:04:06 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Dominic Cleal 2014-12-05 09:01:21 UTC
Created redmine issue http://projects.theforeman.org/issues/8587 from this bug

Comment 5 Bryan Kearney 2015-08-25 18:32:41 UTC
Upstream bug component is API

Comment 6 Bryan Kearney 2016-03-15 16:03:03 UTC
Upstream bug assigned to aruzicka

Comment 7 Adam Ruzicka 2016-03-23 10:31:34 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/8587 has been closed
-------------
Adam Ruzicka
Applied in changeset commit:dac16774f9d741a9ef361f0f6bbce452bdea6b92.

Comment 8 Stephen Benjamin 2016-07-07 18:57:56 UTC
Verified in Satellite 6.2 Snap 19.0 (foreman-1.11.0.43-1.el7sat.noarch)


Host is not managed:

[root@sat-snap-rhel7 ~]# hammer -u admin -p changeme host info --id=1
Id:                 1
Name:               sat-snap-rhel7.example.com
Environment:        production
Puppet CA Id:       1
Puppet Master Id:   1
Cert name:          sat-snap-rhel7.example.com
Managed:            no


Try to change to build=true:

[root@sat-snap-rhel7 ~]# hammer -u admin -p changeme host update --id=1 --build=true
Could not update the host:
  Build mode cannot be enabled for an unmanaged host

Comment 9 Bryan Kearney 2016-07-27 11:38:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501


Note You need to log in before you can comment on or make changes to this bug.