Bug 1207648 - Boootdisk CLI generation does not correctly parse "--full false"
Summary: Boootdisk CLI generation does not correctly parse "--full false"
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Bootdisk Plugin
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Sachin Ghai
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-31 12:19 UTC by Sachin Ghai
Modified: 2017-01-05 14:04 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-05 14:04:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14728 0 None None None 2016-04-22 16:07:41 UTC

Description Sachin Ghai 2015-03-31 12:19:59 UTC
Description of problem:
This is when host is not in build mode:

--[root@dhcp201-113 ~]# hammer --username admin --password changeme bootdisk host --host capbootnode.lab.eng.pnq.redhat.com --full false
Failed to download host disk image:
  ERF42-2893 [Foreman::Exception]: Host is not in build mode, so the template cannot be rendered
[root@dhcp201-113 ~]# hammer --username admin --password changeme bootdisk host --host capbootnode.lab.eng.pnq.redhat.com --full true
Failed to download host disk image:
--

This is when host is in build mode:
--
[root@dhcp201-113 ~]# hammer --username admin --password changeme bootdisk host --host capbootnode.lab.eng.pnq.redhat.com --full false
Successfully downloaded host disk image to capbootnode.lab.eng.pnq.redhat.com_20150331_1813.iso

[root@dhcp201-113 ~]# ll -h capbootnode.lab.eng.pnq.redhat.com_20150331_1813.iso
-rw-r--r--. 1 root root 41M Mar 31 17:43 

capbootnode.lab.eng.pnq.redhat.com_20150331_1813.iso
[root@dhcp201-113 ~]# hammer --username admin --password changeme bootdisk host --host capbootnode.lab.eng.pnq.redhat.com --full true
Successfully downloaded host disk image to capbootnode.lab.eng.pnq.redhat.com_20150331_1813.iso


[root@dhcp201-113 ~]# ll -h capbootnode.lab.eng.pnq.redhat.com_20150331_1813.iso
-rw-r--r--. 1 root root 41M Mar 31 17:44 capbootnode.lab.eng.pnq.redhat.com_20150331_1813.iso
--


Version-Release number of selected component (if applicable):
sat6.1 beta snap8
Satellite-6.1.0-RHEL-7-20150324.0

How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:
when we pass Full=true then downloaded image is of 41MB and we got similar size of image when we pass Full=false

what is difference in true/false flags here ?

Expected results:


Additional info:

Comment 2 Lukas Zapletal 2016-04-06 07:47:29 UTC
I think you need to only provide --full - this is how it works currently in master:

hammer bootdisk generic
hammer bootdisk host --host bdsktest.local.lan
hammer bootdisk host --host bdsktest.local.lan --full
hammer bootdisk subnet --subnet local.lan

Comment 3 Sachin Ghai 2016-04-09 10:13:05 UTC
@lzap: I checked with sat6.2 beta snap6.2, hammer provides following options:

[root@cloud-qe-17 ~]# hammer --username admin --password changeme bootdisk host --host newtest.idmqe.lab.eng.bos.redhat.com --help
Usage:
    hammer bootdisk host [OPTIONS]

Options:
 --file PATH                   File or device to write image to
 --force                       Force writing to existing destination (device etc.)
 --full FULL                   True for full, false for basic reusable image
                               One of true/false, yes/no, 1/0.
 --host HOST_NAME              Host name
 --host-id HOST_ID              
 --sudo                        Use sudo to write to device
 -h, --help                    print help
[root@cloud-qe-17 ~]# 



Please note description of '--full' option. It clearly state "True for full, false for basic reusable image"


If --full flag just works without passing true/false, then please fix the command description.

Comment 4 Lukas Zapletal 2016-04-12 11:36:17 UTC
Unable to reproduce, the comment 2 was not valid, I only proposed the change but it was never changed. What's in the help screen is valid and works for me:

[root@dell-pe1950-06 ~]# hammer --username admin --password admin bootdisk host --host baremetal-dummy-host-01.nested.lan --full true
Successfully downloaded host disk image to baremetal-dummy-host-01.nested.lan_20160412_1733.iso

[root@dell-pe1950-06 ~]# hammer --username admin --password admin bootdisk host --host baremetal-dummy-host-01.nested.lan
Successfully downloaded host disk image to baremetal-dummy-host-01.nested.lan.iso

[root@dell-pe1950-06 ~]# ll
total 46080
-rw-------. 1 root root    20801 Apr 12 05:59 anaconda-ks.cfg
-rw-r--r--. 1 root root 45088768 Apr 12 13:34 baremetal-dummy-host-01.nested.lan_20160412_1733.iso
-rw-r--r--. 1 root root  1048576 Apr 12 13:34 baremetal-dummy-host-01.nested.lan.iso
-rw-r--r--. 1 root root        4 Apr 12 05:57 NETBOOT_METHOD.TXT
-rw-r--r--. 1 root root        8 Apr 12 05:57 RECIPE.TXT
-rw-r--r--. 1 root root  1005479 Apr 12 07:05 script.log
drwx------. 3 root root     4096 Apr 12 06:54 ssl-build

Comment 5 Sachin Ghai 2016-04-20 07:34:31 UTC
Okay, re-verified with sat6.2 beta snap8.2

Bug is still there. 

Case1: when --full set to 'true' ::: works
================================

I can download the Full bootdisk when --full is set to 'true' like:

 ~]# hammer --username admin --password changeme bootdisk host --host testhost.idmqe.lab.eng.bos.redhat.com --full true
Successfully downloaded host disk image to testhost.idmqe.lab.eng.bos.redhat.com_20160420_1321.iso

-rw-r--r--. 1 root root 46137344 Apr 20 03:23 testhost.idmqe.lab.eng.bos.redhat.com_20160420_1321.iso


Case2: without --full flag  :::: works
============================
 ~]# hammer --username admin --password changeme bootdisk host --host testhost.idmqe.lab.eng.bos.redhat.com
Successfully downloaded host disk image to testhost.idmqe.lab.eng.bos.redhat.com.iso

-rw-r--r--. 1 root root  1048576 Apr 20 03:25 testhost.idmqe.lab.eng.bos.redhat.com.iso


Case3: with --full set to 'false' ::: should works like case2:
=============================================================

~]# hammer --username admin --password changeme bootdisk host --host testhost.idmqe.lab.eng.bos.redhat.com --full false
Successfully downloaded host disk image to testhost.idmqe.lab.eng.bos.redhat.com_20160420_1321.iso



Please note help doc for --full :

--full FULL                   True for full, false for basic reusable image
                               One of true/false, yes/no, 1/0.


So if user set --full false then user should get basic image not 'Full' as we are getting case3. So bug is still valid.

Comment 6 Lukas Zapletal 2016-04-20 09:40:41 UTC
Okay, now I see the problem, it was lost somewhere in complex description :-)

TRIAGE:

Not a blocker then, just don't provide the option.

Comment 7 Bryan Kearney 2017-01-05 14:04:27 UTC
This is an older bug which has been reported upstream. We are not going to track this bug downstream. When the upstream issue is resolved, the next build will contain the fix.


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