Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 633988

Summary: Need a --server flag for pulp-admin too
Product: [Retired] Pulp Reporter: Mike McCune <mmccune>
Component: z_otherAssignee: Pradeep Kilambi <pkilambi>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: pthomas
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-16 14:20:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 647488    

Description Mike McCune 2010-09-14 20:27:43 UTC
pulp-client has it:

# pulp-client --server=somebox.example.com consumer create --id=asdf -u admin -p admin

but pulp-admin doesn't:

# pulp-admin repo list --server=somebox.example.com
Usage: pulp-admin -u <username> -p <password> repo list [OPTIONS]


pulp-admin: error: no such option: --server

Comment 1 Mike McCune 2010-11-30 21:57:25 UTC
Looks like we have a --server flag now but you have to use it twice for it to stick:

$ pulp-admin --server=box.example.com repo list
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: [box.example.com] from the server.

Please correct the host in the /etc/pulp/client.conf file
$ pulp-admin --server=box.example.com repo list
No repositories available to list

Comment 2 Pradeep Kilambi 2010-12-22 21:23:28 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 3 Pradeep Kilambi 2011-01-03 21:15:58 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 4 Jay Dobies 2011-01-05 19:45:29 UTC
Fixed in 0.120.

Comment 5 Preethi Thomas 2011-01-06 18:13:53 UTC
[root@preethi ~]# rpm -q pulp
pulp-0.0.121-1.fc14.noarch

[root@preethi ~]# pulp-admin --username=admin --password=admin --server=10.16.79.185 repo list 
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+

Label              	pulp-repo1               
Name               	pulp-repo1               
FeedURL            	http://repos.fedorapeople.org/repos/pulp/pulp/testing/fedora-14/x86_64/
FeedType           	yum                      
Arch               	noarch                   
Sync Schedule      	None                     
Packages           	10                       
Files              	0                        
Distributions      	None                     
Publish            	True                     
Clones             	[]                       
Groups             	None        


[root@preethi ~]# cat /etc/pulp/client.conf |grep host
#     host : The pulp server
host = preethi.usersys.redhat.com

Comment 6 Preethi Thomas 2011-08-16 14:20:50 UTC
Closing with Community Release 15

pulp-0.0.223-4.