Bug 730020
Summary: | subscription-manager config usage | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | John Sefler <jsefler> |
Component: | subscription-manager | Assignee: | William Poteat <wpoteat> |
Status: | CLOSED ERRATA | QA Contact: | John Sefler <jsefler> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.2 | CC: | jmolet, skallesh, spandey, wpoteat |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-12-06 17:23:24 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: | 682238, 743047 |
Description
John Sefler
2011-08-11 14:47:56 UTC
This has been redesigned: --list shows the entries available for modification. The list is dynamically produced from the entries already in the file. It includes the default entries for each section despite the fact that they are not in the actual file. It is a true representation as to what will get used when that entry is called for in the code. --[section].[entry name] [value] Allows the user to change an entry. --remove [section].[entry name] Allows the user to remove an entry value. If there is no default for that entry, the value in the file is changed to [empty string]. if there is a default value, the value in the file is removed completely so that the default value will be expressed. Example of new behavior: [root@jmolet-vm0 ~]# subscription-manager config --list [server] hostname = mgmt5.rhq.lab.eng.bos.redhat.com prefix = /candlepin port = 8443 insecure = 0 ssl_verify_depth = 3 ca_cert_dir = /etc/rhsm/ca/ proxy_hostname = proxy_port = proxy_user = proxy_password = repo_ca_cert = /etc/rhsm/ca/redhat-uep.pem [rhsm] baseurl = https://mockamai.devlab.phx1.redhat.com repo_ca_cert = /etc/rhsm/ca/fakamai-cp1.pem productcertdir = /etc/pki/product entitlementcertdir = /etc/pki/entitlement consumercertdir = /etc/pki/consumer proxy_hostname = insecure = 0 ssl_verify_depth = 3 proxy_password = proxy_port = prefix = /candlepin port = 8443 proxy_user = hostname = localhost ca_cert_dir = /etc/rhsm/ca/ [rhsmcertd] certfrequency = 240 proxy_hostname = insecure = 0 ssl_verify_depth = 3 proxy_password = proxy_port = prefix = /candlepin repo_ca_cert = /etc/rhsm/ca/redhat-uep.pem port = 8443 proxy_user = hostname = localhost ca_cert_dir = /etc/rhsm/ca/ [root@jmolet-vm0 ~]# subscription-manager config --help Usage: subscription-manager config [OPTIONS] List the configuration which this machine is using Options: -h, --help show this help message and exit --list list the configuration for this system --remove=REMOVE remove configuration entry by section.name --server.hostname=SERVER.HOSTNAME Section: server, Name: hostname --server.prefix=SERVER.PREFIX Section: server, Name: prefix --server.port=SERVER.PORT Section: server, Name: port --server.insecure=SERVER.INSECURE Section: server, Name: insecure --server.ssl_verify_depth=SERVER.SSL_VERIFY_DEPTH Section: server, Name: ssl_verify_depth --server.ca_cert_dir=SERVER.CA_CERT_DIR Section: server, Name: ca_cert_dir --server.proxy_hostname=SERVER.PROXY_HOSTNAME Section: server, Name: proxy_hostname --server.proxy_port=SERVER.PROXY_PORT Section: server, Name: proxy_port --server.proxy_user=SERVER.PROXY_USER Section: server, Name: proxy_user --server.proxy_password=SERVER.PROXY_PASSWORD Section: server, Name: proxy_password --server.repo_ca_cert=SERVER.REPO_CA_CERT Section: server, Name: repo_ca_cert --rhsm.baseurl=RHSM.BASEURL Section: rhsm, Name: baseurl --rhsm.repo_ca_cert=RHSM.REPO_CA_CERT Section: rhsm, Name: repo_ca_cert --rhsm.productcertdir=RHSM.PRODUCTCERTDIR Section: rhsm, Name: productcertdir --rhsm.entitlementcertdir=RHSM.ENTITLEMENTCERTDIR Section: rhsm, Name: entitlementcertdir --rhsm.consumercertdir=RHSM.CONSUMERCERTDIR Section: rhsm, Name: consumercertdir --rhsm.proxy_hostname=RHSM.PROXY_HOSTNAME Section: rhsm, Name: proxy_hostname --rhsm.insecure=RHSM.INSECURE Section: rhsm, Name: insecure --rhsm.ssl_verify_depth=RHSM.SSL_VERIFY_DEPTH Section: rhsm, Name: ssl_verify_depth --rhsm.proxy_password=RHSM.PROXY_PASSWORD Section: rhsm, Name: proxy_password --rhsm.proxy_port=RHSM.PROXY_PORT Section: rhsm, Name: proxy_port --rhsm.prefix=RHSM.PREFIX Section: rhsm, Name: prefix --rhsm.port=RHSM.PORT Section: rhsm, Name: port --rhsm.proxy_user=RHSM.PROXY_USER Section: rhsm, Name: proxy_user --rhsm.hostname=RHSM.HOSTNAME Section: rhsm, Name: hostname --rhsm.ca_cert_dir=RHSM.CA_CERT_DIR Section: rhsm, Name: ca_cert_dir --rhsmcertd.certfrequency=RHSMCERTD.CERTFREQUENCY Section: rhsmcertd, Name: certfrequency --rhsmcertd.proxy_hostname=RHSMCERTD.PROXY_HOSTNAME Section: rhsmcertd, Name: proxy_hostname --rhsmcertd.insecure=RHSMCERTD.INSECURE Section: rhsmcertd, Name: insecure --rhsmcertd.ssl_verify_depth=RHSMCERTD.SSL_VERIFY_DEPTH Section: rhsmcertd, Name: ssl_verify_depth --rhsmcertd.proxy_password=RHSMCERTD.PROXY_PASSWORD Section: rhsmcertd, Name: proxy_password --rhsmcertd.proxy_port=RHSMCERTD.PROXY_PORT Section: rhsmcertd, Name: proxy_port --rhsmcertd.prefix=RHSMCERTD.PREFIX Section: rhsmcertd, Name: prefix --rhsmcertd.repo_ca_cert=RHSMCERTD.REPO_CA_CERT Section: rhsmcertd, Name: repo_ca_cert --rhsmcertd.port=RHSMCERTD.PORT Section: rhsmcertd, Name: port --rhsmcertd.proxy_user=RHSMCERTD.PROXY_USER Section: rhsmcertd, Name: proxy_user --rhsmcertd.hostname=RHSMCERTD.HOSTNAME Section: rhsmcertd, Name: hostname --rhsmcertd.ca_cert_dir=RHSMCERTD.CA_CERT_DIR Section: rhsmcertd, Name: ca_cert_dir --remove and setting values work as expected as well. setting and listing in the same command still behaves the same way as it did when this bug was opened. (In reply to comment #0) > Also, we should probably block when the user includes --list option together > with a setter option. Like this: > # subscription-manager config --list --proxy_port=222 > hostname = jsefler-onprem-62candlepin.usersys.redhat.com > prefix = /candlepin > port = 8443 > insecure = 0 > ssl_verify_depth = 3 > ca_cert_dir = /etc/rhsm/ca/ > proxy_hostname = 200 > proxy_port = --proxy_hostname > proxy_user = > proxy_password = > repo_ca_cert = /etc/rhsm/ca/redhat-uep.pem > > > ^^^ THE SETTER WAS IGNORED. EXPECTED SOMETHING LIKE: > Error: --list should not be used with options used for setting configurations > Moving this back to ASSIGNED as this still needs to be fixed. (In reply to comment #0) > Please consider changing the in-line help as follows: > > [root@jsefler-onprem-62server ~]# subscription-manager config --help > Usage: subscription-manager config [OPTIONS] > > List the configuration which this machine is using > > ^^^^^^ NEEDS TO INCLUDE THE WORD "SET". Something like this would be good: > List or set various entitlement system configuration values Was this request overlooked or vetoed? the help text is fixed in 161be6097da810447d94414d56fcbdd8eb425a52 Lets try this again.... [root@jsefler-onprem-62server ~]# subscription-manager config -h | grep Usage -A2 Usage: subscription-manager config [OPTIONS] List or set the configuration which this machine is using ^^^^ PLEASE CHANGE THE USAGE MESSAGE TO INCLUDE ALL THREE FUNCTIONS list, set, remove: List, set or remove configuration parameters in use by this machine AND STILL UNRESOLVED is the case when the user includes --list option together with a setter option or a remove. Like this: # subscription-manager config --list --rhsm.proxy_port=22 --remove rhsm.proxy_port Expected stderr output: Error: --list should not be used with any other options for setting or removing configurations Expected exit code: 255 Moving back to NEW Final Verifications... [root@jsefler-onprem-62server ~]# rpm -q subscription-manager subscription-manager-0.96.11-1.el6.x86_64 [root@jsefler-onprem-62server ~]# subscription-manager config -h | grep Usage -A2 Usage: subscription-manager config [OPTIONS] List, set, or remove the configuration parameters in use by this machine. ^^^^ ^^^ ^^^^^^ ALL THREE FUNCTIONS OF THIS MODULE ARE NOW LISTED IN THE USAGE [root@jsefler-onprem-62server ~]# subscription-manager config --list --rhsm.proxy_port=22 --remove rhsm.proxy_port Error: --list should not be used with any other options for setting or removing configurations. [root@jsefler-onprem-62server ~]# subscription-manager config --list --rhsm.proxy_port=22 Error: --list should not be used with any other options for setting or removing configurations. [root@jsefler-onprem-62server ~]# subscription-manager config --list --remove rhsm.proxy_port Error: --list should not be used with any other options for setting or removing configurations. [root@jsefler-onprem-62server ~]# ^^^^ VERIFIED THAT LIST SHOULD NOT BE CALLED WITH SET AND/OR REMOVE OPTIONS moving to VERIFIED NOTE: It's bad practice to combine calls to set and remove configs at the same time, e.g.... subscription-manager config --rhsm.proxy_port=22 --remove rhsm.proxy_port Make two separate calls instead. e.g.... subscription-manager config --rhsm.proxy_port=22 subscription-manager config --remove rhsm.proxy_port Ooops... pulled the trigger too fast moving back to ASSIGNED... [root@jsefler-onprem-62server ~]# subscription-manager config --list --rhsm.proxy_port=22 --remove rhsm.proxy_port 1>/tmp/stdout 2>/tmp/stderr [root@jsefler-onprem-62server ~]# echo $? 255 [root@jsefler-onprem-62server ~]# cat /tmp/stderr [root@jsefler-onprem-62server ~]# cat /tmp/stdout Error: --list should not be used with any other options for setting or removing configurations. [root@jsefler-onprem-62server ~]# ^^^ THE ERROR MESSAGE SHOULD GO TO STDERR NOT STDOUT Changed error logging to sys.stderr.write for ConfigComand. Commit: 600f2813db4471955e9f1efdfe4a5a1d270f7133 Issues in comment 10 look resolved: [root@jmolet-vm0 ~]# subscription-manager config --list --rhsm.proxy_port=22 --remove rhsm.proxy_port 1>/tmp/stdout 2>/tmp/stder [root@jmolet-vm0 ~]# echo $? 255 [root@jmolet-vm0 ~]# cat /tmp/stderr Error: Section rhsmcertd and name unknown_prop does not exist. [root@jmolet-vm0 ~]# cat /tmp/stdout [root@jmolet-vm0 ~]# Marking VERIFIED. Tests were performed against version: subscription-manager-0.96.11-1.git.11.4ea289b.el6.x86_64 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. http://rhn.redhat.com/errata/RHBA-2011-1695.html |