Bug 1320507
| Summary: | Wrong prefix prompts when register using serverurl without prefix | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | qianzhan |
| Component: | subscription-manager | Assignee: | William Poteat <wpoteat> |
| Status: | CLOSED ERRATA | QA Contact: | John Sefler <jsefler> |
| Severity: | low | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.8 | CC: | bcourt, csnyder, jgalipea, ldai, wpoteat |
| Target Milestone: | rc | Keywords: | Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-03-21 10:54:44 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
qianzhan
2016-03-23 11:29:17 UTC
Reproducing the failure... [root@jsefler-6 ~]# subscription-manager config --server.hostname=hostname --server.port=123 --server.prefix=/prefix [root@jsefler-6 ~]# [root@jsefler-6 ~]# subscription-manager register Registering to: hostname:123/prefix <===== VERIFIED/EXPECTED Username: ^C User interrupted process. [root@jsefler-6 ~]# [root@jsefler-6 ~]# subscription-manager register --serverurl=jsefler-f22-candlepin.usersys.redhat.com:8443/candlepin --insecure Registering to: jsefler-f22-candlepin.usersys.redhat.com:8443/candlepin <===== VERIFIED/EXPECTED Username: testuser1 Password: Organization: admin The system has been registered with ID: 932b5cf9-2a2e-445e-ab69-be7d4ce76856 [root@jsefler-6 ~]# [root@jsefler-6 ~]# subscription-manager unregister System has been unregistered. [root@jsefler-6 ~]# [root@jsefler-6 ~]# subscription-manager register Registering to: jsefler-f22-candlepin.usersys.redhat.com:8443/candlepin <==== VERIFIED/EXPECTED Username: ^C User interrupted process. [root@jsefler-6 ~]# [root@jsefler-6 ~]# subscription-manager register --serverurl=jsefler-f22-candlepin.usersys.redhat.com Unable to reach the server at jsefler-f22-candlepin.usersys.redhat.com:443/subscription <==== FAILED [root@jsefler-6 ~]# [root@jsefler-6 ~]# subscription-manager config | egrep " hostname| port| prefix" hostname = jsefler-f22-candlepin.usersys.redhat.com port = 8443 prefix = /candlepin [root@jsefler-6 ~]# The configured port and prefix were NOT used when the port and prefix were absent from the specified --serverurl value. Instead the default port 443 and default prefix /subscription were used. Fix merged to upstream master as of the below commit. As it is in before the branch for 6.9, moving to modified.
commit ea10b99095ad58df57ed107e13bf19498e003ae8
Author: William Poteat <wpoteat>
Date: Mon Apr 11 13:28:43 2016 -0400
1320507: Use config entry before default for port and prefix
fixed in subscription-manager-1.17.5-1 (In reply to John Sefler from comment #6) > fixed in subscription-manager-1.17.5-1 Trying to verify the bug on RHEL-7.3-RC-2.0: subscription-manager: 1.17.15-1.el7 python-rhsm: 1.17.9-1.el7 1 Specifying the port and prefix in CLI: 1) With rhsm.conf configured. [root@dhcp-128-71 ~]# egrep "hostname|port|prefix" /etc/rhsm/rhsm.conf # Server hostname: hostname = samserv.redhat.com # Server prefix: prefix = /sam/api # Server port: port = 443 [root@dhcp-128-71 ~]# subscription-manager config | egrep " hostname| port| prefix" hostname = samserv.redhat.com port = [443] prefix = /sam/api [root@dhcp-128-71 ~]# subscription-manager register --serverurl=samserv.redhat.com:443/sam/api Registering to: samserv.redhat.com:443/sam/api Username: admin Password: The system has been registered with ID: 40d17a2a-1268-425b-a030-86da77a6f980 2) Without rhsm.conf configured. [root@dhcp-128-71 ~]# subscription-manager config | egrep " hostname| port| prefix" hostname = samserv.redhat.com port = [443] prefix = [/subscription] [root@dhcp-128-71 ~]# egrep "hostname|port|prefix" /etc/rhsm/rhsm.conf # Server hostname: hostname = samserv.redhat.com # Server prefix: prefix = # Server port: port = [root@dhcp-128-71 ~]# subscription-manager register --serverurl=samserv.redhat.com:443/sam/api Registering to: samserv.redhat.com:443/sam/api Username: admin Password: The system has been registered with ID: 8eace28d-cd09-4c14-b5d6-bc331a2a8e53 Verified. CLI with registration takes first priority over conf and default value. 2. Without CLI, rhsm.conf file is configured. [root@dhcp-128-71 ~]# subscription-manager unregister System has been unregistered. [root@dhcp-128-71 ~]# egrep "hostname|port|prefix" /etc/rhsm/rhsm.conf # Server hostname: hostname = samserv.redhat.com # Server prefix: prefix = /sam/api # Server port: port = 443 [root@dhcp-128-71 ~]# subscription-manager config | egrep " hostname| port| prefix" hostname = samserv.redhat.com port = [443] prefix = /sam/api [root@dhcp-128-71 ~]# subscription-manager register --serverurl=samserv.redhat.com Registering to: samserv.redhat.com:443/sam/api Username: admin Password: The system has been registered with ID: 3b501cd2-06bd-40b9-97c4-cc6fe945a868 Verified. Registration uses the configured rhsm.conf file when NOT specifying port and prefix in cli. 3. Without CLI or rhsm.conf. [root@dhcp-128-71 ~]# subscription-manager unregister System has been unregistered. [root@dhcp-128-71 ~]# egrep "hostname|port|prefix" /etc/rhsm/rhsm.conf # Server hostname: hostname = samserv.redhat.com # Server prefix: prefix = # Server port: port = [root@dhcp-128-71 ~]# subscription-manager config | egrep " hostname| port| prefix" hostname = samserv.redhat.com port = [443] prefix = [/subscription] [root@dhcp-128-71 ~]# subscription-manager register --serverurl=samserv.redhat.com Registering to: samserv.redhat.com:443/subscription Username: admin Password: The system has been registered with ID: 4e1c26d0-8940-47ad-87f5-156ec3ba5cae Verified. The default port and prefix value play roles when no cli specified or rhsm.conf configured. 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://rhn.redhat.com/errata/RHSA-2017-0698.html |