Bug 658162 - pulp-client needs to use --server twice for 'consumer create'
Summary: pulp-client needs to use --server twice for 'consumer create'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: ---
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On: 655256
Blocks: verified-to-close
TreeView+ depends on / blocked
 
Reported: 2010-11-29 14:45 UTC by Preethi Thomas
Modified: 2013-09-09 16:32 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 655256
Environment:
Last Closed: 2011-08-16 14:02:23 UTC
Embargoed:


Attachments (Terms of Use)

Description Preethi Thomas 2010-11-29 14:45:31 UTC
+++ This bug was initially created as a clone of Bug #655256 +++

Two issues when trying to create a new consumer:

1) I have to issue the --server flag twice

2) After successfully creating the consumer I still have to use --username and --password to list repos

$ sudo pulp-client --server=gibson.pdx.redhat.com consumer create --id=gibson
ERROR: The server hostname you have configured in /etc/pulp/client.conf does not match the hostname returned from the Pulp server you are connecting to.  

You have: [localhost] configured but got: [gibson.pdx.redhat.com] from the server.

Please correct the host in the /etc/pulp/client.conf file
$ sudo pulp-client --server=gibson.pdx.redhat.com consumer create --id=gibson
error: operation failed: "Authorization failed. Check your username and password or your certificate"

$ sudo pulp-client --username=admin --password=redhat --server=gibson.pdx.redhat.com consumer create --id=gibson
Successfully created consumer [ gibson ]

$ sudo pulp-client repo list
error: operation failed: "Authorization failed. Check your username and password or your certificate"

$ sudo pulp-client --username=admin --password=admin repo list
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Label              	f14-x86_64               
....

--- Additional comment from pkilambi on 2010-11-23 09:34:02 EST ---

fixed!
commit 79462a0bf7cb4f782970b89ceb15f7d74c9c9daa
Author: Pradeep Kilambi <pkilambi>
Date:   Tue Nov 23 09:34:06 2010 -0500

--- Additional comment from jason.dobies on 2010-11-29 09:16:04 EST ---

Fixed in 0.109.

--- Additional comment from pthomas on 2010-11-29 09:28:16 EST ---

Looks like this is fails_qa 

[root@preethi ~]# pulp-client --server=preethi.usersys.redhat.com consumer create --id=preethi.usersys.redhat.com
ERROR: The server hostname you have configured in /etc/pulp/client.conf does not match the
hostname returned from the Pulp server you are connecting to.  

You have: [localhost.localdomain] configured but got: [preethi.usersys.redhat.com] from the server.

Please correct the host in the /etc/pulp/client.conf file
You have new mail in /var/spool/mail/root
[root@preethi ~]# pulp-client --server=preethi.usersys.redhat.com consumer create --id=preethi.usersys.redhat.com
error: operation failed: "Authorization failed. Check your username and password or your certificate"
[root@preethi ~]# pulp-client -u admin -p admin --server=preethi.usersys.redhat.com consumer create --id=preethi.usersys.redhat.com
Successfully created consumer [ preethi.usersys.redhat.com ]


The second part is a pass
[root@preethi ~]# pulp-client repo list
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Label              	f13                      
Name               	f13                      
FeedURL            	http://download.devel.redhat.com/released/F-13/GOLD/Fedora/x86_64/os/
FeedType           	yum                      
Arch               	x86_64                   
Sync Schedule      	None                     
Packages           	3102                     
Files              	0                        
Distributions      	ks-f13-x86_64            
Publish            	True                     
Clones             	[]

Comment 1 Pradeep Kilambi 2010-12-22 21:23:45 UTC
conclusion from discussion on IRC:

* fix the requirement to run --server 2x before it works
* dont override conf with server value

if you want to permanently change it, edit the conf file

Comment 2 Pradeep Kilambi 2011-01-03 21:16:06 UTC
commit f40ffff0efbc2843af6612befe1cc60e0ad5304c
Author: Pradeep Kilambi <pkilambi>
Date:   Mon Jan 3 16:12:54 2011 -0500

    633988, 658162 - server option enhancements:
    
    * server option will not update config file any more and picks up server url at runtime from cli
    
    * user shouldnt have to run commands twice to take effect

Test:

* --server should take precedence over config
* if no --server cli uses config url
* config is not overwritten when --server is specified

Comment 3 Jay Dobies 2011-01-05 19:45:22 UTC
Fixed in 0.120.

Comment 4 Preethi Thomas 2011-01-07 15:26:17 UTC
Verified

[root@10 ~]# rpm -q pulp
pulp-0.0.121-1.fc14.noarch
[root@10 ~]# pulp-client --help
Usage: pulp-client <options> <command>
Supported Commands:
	consumer       consumer specific actions to pulp server
	errata         errata specific actions to pulp server
	repo           repository specific actions to pulp server

Options:
  -h, --help            show this help message and exit

  Pulp User Account Credentials:
    -u USERNAME, --username=USERNAME
                        account username
    -p PASSWORD, --password=PASSWORD
                        account password
    -s SERVER, --server=SERVER
                        pulp server host
[root@10 ~]# 




When --server option is specified the result as follows



[root@10 ~]# pulp-client --server=preethi.usersys.redhat.com -u admin -p admin consumer create  --id=10.16.79.226 
warning: this client is not registered; please register to continue
Successfully created consumer [ 10.16.79.226 ]


On the server

[root@preethi ~]# pulp-admin consumer list
+------------------------------------------+
            Consumer Information
+------------------------------------------+

Id                 	preethi.usersys.redhat.com
Description        	None                     
Subscribed Repos   	/pulp/api/consumers/preethi.usersys.redhat.com/repoids/
Additional info    	{}                       


Id                 	10.16.79.226             
Description        	None                     
Subscribed Repos   	/pulp/api/consumers/10.16.79.226/repoids/
Additional info    	{}                     
[root@10 ~]# pulp-client --server=preethi.usersys.redhat.com -u admin -p admin consumer create  --id=10.16.79.226 
warning: this client is not registered; please register to continue
Successfully created consumer [ 10.16.79.226 ]


When --server is not specified the config is being used



[root@10 ~]# pulp-client -u admin -p admin consumer create  --id=10.16.79.226 warning: this client is not registered; please register to continue
Successfully created consumer [ 10.16.79.226 ]

[root@10 ~]# pulp-admin consumer list+------------------------------------------+
            Consumer Information
+------------------------------------------+

Id                 	10.16.79.226             
Description        	None                     
Subscribed Repos   	/pulp/api/consumers/10.16.79.226/repoids/
Additional info    	{}

Comment 5 Preethi Thomas 2011-08-16 14:02:23 UTC
Closing with Community Release 15

pulp-0.0.223-4.


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