Description of problem: Cloning a channel via API fails if channel label starts with a digit. The problem is that the regular expression that verifies the channel label when the channel is cloned via API is not correct: Pattern.compile("^[a-z][a-z\\d\\-\\.\\_]*$", Pattern.CASE_INSENSITIVE); The correct one is the one used when the channel is cloned on WebUI: $channel_label =~ /^[a-z\d][a-z\d\-\.\_]*$/ Version-Release number of selected component (if applicable): spacewalk-java-2.1.28-1 How reproducible: 100 Steps to Reproduce: 1. Execute the following script. import sys, xmlrpclib RHN_SERVER='https://xxxx.redhat.com/rpc/api' RHN_USER='xxxx' RHN_PASS='xxxx' client = xmlrpclib.Server(RHN_SERVER, verbose=0) key = client.auth.login(RHN_USER, RHN_PASS) client.channel.software.create(key,'test_label','test_name','summary','channel-x86_64','') client.channel.software.clone(key,'test_label',{'name':'clone-test_name','label':'222clone-test_label','summary':'test summary',},True) Actual results: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.7/xmlrpclib.py", line 1224, in __call__ return self.__send(self.__name, args) File "/usr/lib64/python2.7/xmlrpclib.py", line 1578, in __request verbose=self.__verbose File "/usr/lib64/python2.7/xmlrpclib.py", line 1264, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib64/python2.7/xmlrpclib.py", line 1297, in single_request return self.parse_response(response) File "/usr/lib64/python2.7/xmlrpclib.py", line 1473, in parse_response return u.close() File "/usr/lib64/python2.7/xmlrpclib.py", line 793, in close raise Fault(**self._stack[0]) xmlrpclib.Fault: <Fault -1: "redstone.xmlrpc.XmlRpcFault: unhandled internal exception: The channel parameter 222clone-test_label is invalid. It Must be at least 6 characters long, begin with a letter, and contain only lowercase letters, digits, '-', '_', and '.'. Also, it cannot begin with 'rhn', 'redhat', or 'red hat'."> Expected results: The channel is cloned successfully as it will happen if the same action was done on WebUI. Additional info:
Fixed in Spacewalk Master: bec830185e23457cc913633c7a7fe7ac41a0183a
Making the Comment#1 public, as it is a commit to Spacewalk master. Dimitar, this commit does not fix the described issue. The code you touched gets applied in case of channel cloning, but not creation. However, if we touch the channel name and label regexp, we would like to re-use the regexp defined on one place - for webui and for api. Please, either re-work the patch or revert it. Changing to ASSIGNED.
> The code you touched gets applied in case of channel cloning, but not creation. Taking back, this bus is about channel cloning. My fault. Keeping on ASSIGNED, as I'll do the basic re-factoring.
We have re-reviewed this bug, as part of an ongoing effort to improve Satellite/Proxy feature and bug updates, review and backlog. This is a low priority bug and has no currently open customer cases. While this bug may still valid, we do not see it being implemented prior to the EOL of the Satellite 5.x product. As such, this is being CLOSED DEFERRED. Closing now to help set customer expectations as early as possible. You are welcome to re-open this bug if needed.