Bug 1380311 - API client.channel.software.createRepo() in 5.8.0 allows "yum" repo type only, 5.7.0 used "YUM"
Summary: API client.channel.software.createRepo() in 5.8.0 allows "yum" repo type only...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Jiří Dostál
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks: 1340444
TreeView+ depends on / blocked
 
Reported: 2016-09-29 09:23 UTC by Jan Hutař
Modified: 2017-06-21 12:14 UTC (History)
6 users (show)

Fixed In Version: spacewalk-java-2.5.14-70-sat
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-21 12:14:46 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Jan Hutař 2016-09-29 09:23:30 UTC
Description of problem:
API client.channel.software.createRepo() in 5.8.0 builds accepts only "yum" as a repository type and not "YUM" as it accepted in 5.7.0


Version-Release number of selected component (if applicable):
spacewalk-java-2.5.14-8.el6sat.noarch


How reproducible:
always


Steps to Reproduce:
1. See https://<sat580_fqdn>/rhn/apidoc/handlers/ChannelSoftwareHandler.jsp#createRepo


Actual results:
API calls returns error when you create repository with type set to "YUM"


Expected results:
Repository type "YUM" should work

Comment 1 Jan Hutař 2016-09-29 09:24:13 UTC
Also reported bug 1380304 for this same API function.

Comment 3 Jiří Dostál 2016-09-30 08:23:46 UTC
spacewalk.git bae9b3d3e05e7bcc040ba039932c58bfe34141c1

Comment 6 Radovan Drazny 2016-11-08 11:46:26 UTC
Verified on spacewalk-java-2.5.14-22.el6sat. Creation of a new repo using the "channel.software.createRepo" API call now accepts any combination of (lower|upper)case of letters for the repository type field.

In [12]: client58.channel.software.createRepo(key58, "testrepo4", "yum", "http://localhost/testrepo4")
Out[12]: 
{'id': 503,
 'label': 'testrepo4',
 'sourceUrl': 'http://localhost/testrepo4',
 'sslCaDesc': '',
 'sslCertDesc': '',
 'sslKeyDesc': '',
 'type': 'yum'}

In [13]: client58.channel.software.createRepo(key58, "testrepo5", "YUM", "http://localhost/testrepo5")
Out[13]: 
{'id': 504,
 'label': 'testrepo5',
 'sourceUrl': 'http://localhost/testrepo5',
 'sslCaDesc': '',
 'sslCertDesc': '',
 'sslKeyDesc': '',
 'type': 'yum'}

In [14]: client58.channel.software.createRepo(key58, "testrepo6", "yuM", "http://localhost/testrepo6")
Out[14]: 
{'id': 505,
 'label': 'testrepo6',
 'sourceUrl': 'http://localhost/testrepo6',
 'sslCaDesc': '',
 'sslCertDesc': '',
 'sslKeyDesc': '',
 'type': 'yum'}

Comment 7 Lukáš Hellebrandt 2017-04-06 12:17:07 UTC
createRepo is overloaded and its version with 3 additional ssl parameters is not fixed (type is only converted to lowercase in the one without these parameters).

Reproducer in python:

client.channel.software.createRepo(key,"newrepo","yUm","http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64","RHN-ORG-TRUSTED-SSL-CERT","RHN-ORG-TRUSTED-SSL-CERT","RHN-ORG-TRUSTED-SSL-CERT")

Comment 8 Jiří Dostál 2017-04-06 16:16:52 UTC
spacewalk bf5d211e9d6329e2bd5aebefb2c0167ea7d36f26

Comment 11 Lukáš Hellebrandt 2017-04-20 11:59:37 UTC
Verified with spacewalk-java-2.5.14-71 .

Tried with both versions of the API call and both now work with any combination of lowercase/uppercase characters.


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