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 1212069 - --csv option cause hammer to interactively ask for user and password
Summary: --csv option cause hammer to interactively ask for user and password
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Martin Bacovsky
QA Contact: Corey Welton
URL: http://projects.theforeman.org/issues...
Whiteboard: Verified in Upstream
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-15 13:41 UTC by Jan Hutař
Modified: 2019-09-25 20:50 UTC (History)
4 users (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 10902 0 None None None 2016-04-22 15:40:35 UTC

Description Jan Hutař 2015-04-15 13:41:13 UTC
Description of problem:
"--csv" option cause hammer to interactively ask for user and password (at least for "product list")


Version-Release number of selected component (if applicable):
rubygem-hammer_cli-0.1.4.8-1.el6_6sat.noarch
Satellite-6.1.0-RHEL-6-20150409.0-Satellite-x86_64


How reproducible:
always


Steps to Reproduce:
# hammer --username 'admin' --password '<pass>' product list --organization-id '3' --per-page 1000
---|------------------------------------------------------------|-------------|--------------|--------------|-----------
ID | NAME                                                       | DESCRIPTION | ORGANIZATION | REPOSITORIES | SYNC STATE
---|------------------------------------------------------------|-------------|--------------|--------------|-----------
1  | Red Hat Beta                                               |             | satellite-qa | 0            | not_synced
8  | Red Hat Enterprise Linux High Availability for RHEL Server |             | satellite-qa | 0            | not_synced
12 | Red Hat Enterprise Linux Load Balancer for RHEL Server     |             | satellite-qa | 0            | not_synced
9  | Red Hat Enterprise Linux Server                            |             | satellite-qa | 1            | finished  
10 | Red Hat Satellite                                          |             | satellite-qa | 0            | not_synced
7  | Red Hat Satellite 6 Beta                                   |             | satellite-qa | 0            | not_synced
6  | Red Hat Satellite Beta                                     |             | satellite-qa | 0            | not_synced
4  | Red Hat Satellite Capsule                                  |             | satellite-qa | 0            | not_synced
2  | Red Hat Satellite Capsule Beta                             |             | satellite-qa | 0            | not_synced
5  | Red Hat Satellite with Embedded Oracle                     |             | satellite-qa | 0            | not_synced
11 | Red Hat Software Collections Beta for RHEL Server          |             | satellite-qa | 0            | not_synced
3  | Red Hat Software Collections for RHEL Server               |             | satellite-qa | 0            | not_synced
---|------------------------------------------------------------|-------------|--------------|--------------|-----------
# hammer --csv --username 'admin' --password '<pass>' product list --organization-id '3' --per-page 1000
[Foreman] Username: admin
[Foreman] Password for admin: 
ID,Name,Description,Organization,Repositories,Sync State
1,Red Hat Beta,,satellite-qa,0,not_synced
8,Red Hat Enterprise Linux High Availability for RHEL Server,,satellite-qa,0,not_synced
12,Red Hat Enterprise Linux Load Balancer for RHEL Server,,satellite-qa,0,not_synced
9,Red Hat Enterprise Linux Server,,satellite-qa,1,finished
10,Red Hat Satellite,,satellite-qa,0,not_synced
7,Red Hat Satellite 6 Beta,,satellite-qa,0,not_synced
6,Red Hat Satellite Beta,,satellite-qa,0,not_synced
4,Red Hat Satellite Capsule,,satellite-qa,0,not_synced
2,Red Hat Satellite Capsule Beta,,satellite-qa,0,not_synced
5,Red Hat Satellite with Embedded Oracle,,satellite-qa,0,not_synced
11,Red Hat Software Collections Beta for RHEL Server,,satellite-qa,0,not_synced
3,Red Hat Software Collections for RHEL Server,,satellite-qa,0,not_synced


Actual results:
When you use "--csv" option when listing products, you have to enter username/password even when defined on command-line - see examples above.


Expected results:
When you have "--username" and "--password" on command-line, you should not be asked to enter these again even with "--csv" option present.

Comment 2 Bryan Kearney 2015-06-16 20:37:43 UTC
I can not recreate on SNAP8. Can you please re-verify

[root@satellite61 lab_exercises]# rpm -qa | grep hammer
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el7sat.noarch
rubygem-hammer_cli-0.1.4.11-1.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.4.14-1.el7sat.noarch
rubygem-hammer_cli_gutterball-0.0.1.2-1.el7sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.7-1.el7sat.noarch
rubygem-hammer_cli_katello-0.0.7.15-1.el7sat.noarch
rubygem-hammer_cli_import-0.10.17-1.el7sat.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.4-1.el7sat.noarch
[root@satellite61 lab_exercises]#

Comment 3 Tazim Kolhar 2015-06-17 11:44:19 UTC
FAILEDQA:

# rpm -qa | grep foreman
foreman-compute-1.7.2.27-1.el6_6sat.noarch
ruby193-rubygem-foreman-redhat_access-0.2.0-8.el6_6sat.noarch
foreman-vmware-1.7.2.27-1.el6_6sat.noarch
ruby193-rubygem-foreman_gutterball-0.0.1.9-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3.4-1.el6_6sat.noarch
foreman-ovirt-1.7.2.27-1.el6_6sat.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el6_6sat.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2.13-1.el6_6sat.noarch
rubygem-hammer_cli_foreman-0.1.4.14-1.el6_6sat.noarch
foreman-selinux-1.7.2.13-1.el6_6sat.noarch
foreman-libvirt-1.7.2.27-1.el6_6sat.noarch
foreman-gce-1.7.2.27-1.el6_6sat.noarch
ruby193-rubygem-foreman_discovery-2.0.0.15-1.el6_6sat.noarch
foreman-proxy-1.7.2.5-1.el6_6sat.noarch
tyan-gt24-08.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
rubygem-hammer_cli_foreman_discovery-0.0.1.10-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_docker-0.0.3.7-1.el6_6sat.noarch
tyan-gt24-08.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
ruby193-rubygem-foreman_docker-1.2.0.14-1.el6_6sat.noarch
foreman-postgresql-1.7.2.27-1.el6_6sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.1.2.7-1.el6_6sat.noarch
tyan-gt24-08.rhts.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch
foreman-1.7.2.27-1.el6_6sat.noarch
ruby193-rubygem-foreman-tasks-0.6.12.8-1.el6_6sat.noarch
foreman-debug-1.7.2.27-1.el6_6sat.noarch


steps
# hammer --csv --username admin --password changeme product list --organization-id '1' --per-page 1000
[Foreman] Username: admin
[Foreman] Password for admin: 
ID,Name,Description,Organization,Repositories,Sync State
129,RHEL6,,Default Organization,1,finished
130,RHEL7,,Default Organization,1,finished
128,Sat6Capsule,,Default Organization,1,finished
132,Sat6Capsule_rhel7,,Default Organization,1,finished
127,Sat6Tools,,Default Organization,1,finished
131,Sat6Tools7,,Default Organization,1,finished

It is still asking for username and password, even though the details are
provided in command line

# hammer --username admin --password changeme product list --organization-id '1' --per-page 1000
----|-------------------|-------------|----------------------|--------------|-----------
ID  | NAME              | DESCRIPTION | ORGANIZATION         | REPOSITORIES | SYNC STATE
----|-------------------|-------------|----------------------|--------------|-----------
129 | RHEL6             |             | Default Organization | 1            | finished  
130 | RHEL7             |             | Default Organization | 1            | finished  
128 | Sat6Capsule       |             | Default Organization | 1            | finished  
132 | Sat6Capsule_rhel7 |             | Default Organization | 1            | finished  
127 | Sat6Tools         |             | Default Organization | 1            | finished  
131 | Sat6Tools7        |             | Default Organization | 1            | finished  
----|-------------------|-------------|----------------------|--------------|-----------

Comment 4 Martin Bacovsky 2015-06-22 17:31:50 UTC
--csv switch is breaking the command line persing. I'm working on the fix.

Workaround: use --csv after the credentials:
hammer --username admin --password changeme --csv product list --organization-id '1' --per-page 1000

Comment 5 Martin Bacovsky 2015-06-22 18:50:59 UTC
Created redmine issue http://projects.theforeman.org/issues/10902 from this bug

Comment 6 Martin Bacovsky 2015-07-16 20:52:08 UTC
Upstream bug was merged, moving to POST

Comment 7 Tazim Kolhar 2015-10-19 10:26:16 UTC
*** This bug is verified in upstream.  This fix should eventually land in future downstream builds ***
Version Tested:

# rpm -qa | grep foreman
nec-em17.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
foreman-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.3-4.el7.noarch
nec-em17.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
tfm-rubygem-hammer_cli_foreman-0.4.0-1.201510071112git33fd59b.el7.noarch
foreman-debug-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
foreman-release-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
foreman-postgresql-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
foreman-vmware-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
tfm-rubygem-foreman_hooks-0.3.9-1.el7.noarch
tfm-rubygem-foreman-tasks-0.7.6-1.fm1_10.el7.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.8-1.el7.noarch
tfm-rubygem-foreman_bootdisk-6.0.0-2.fm1_10.el7.noarch
foreman-release-scl-1-1.el7.x86_64
foreman-libvirt-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
foreman-selinux-1.11.0-0.develop.201510071426git6234447.el7.noarch
foreman-ovirt-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3-3.el7.noarch
tfm-rubygem-foreman_gutterball-0.0.1-3.el7.noarch
nec-em17.rhts.eng.bos.redhat.com-foreman-proxy-1.0-2.noarch
tfm-rubygem-foreman_discovery-4.1.0-1.fm1_10.el7.noarch
tfm-rubygem-foreman_docker-1.4.1-2.fm1_10.el7.noarch
foreman-proxy-1.11.0-0.develop.201510120849git5f36f2e.el7.noarch
foreman-compute-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
foreman-gce-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch

steps:
# hammer --csv --username admin --password changeme product list --organization-id 1 --per-page 100
ID,Name,Description,Organization,Repositories,Sync State
1,test_prod,,Default Organization,1,

Comment 11 Bryan Kearney 2016-07-27 11:42:56 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.