+++ This bug was initially created as a clone of Bug #728173 +++
Description of problem:
When I run spacewalk-create-channel without specifying server, it will end with traceback.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. spacewalk-create-channel --user=admin --version=5 --update=u6 --release=server --arch=x86_64 --destChannel=channel56
[root@XYZ ~]# spacewalk-create-channel --user=admin --version=5 --update=u6 --release=server --arch=x86_64 --destChannel=channel56
No server specified, defaulting to localhost.
You have not specified a source channel, we will try to determine it from inputs
Trying with source channel: rhel-x86_64-server-5
Traceback (most recent call last):
File "/usr/bin/spacewalk-create-channel", line 450, in ?
File "/usr/bin/spacewalk-create-channel", line 172, in main
client = Server(proto + "://" + server + "/rpc/api")
TypeError: cannot concatenate 'str' and 'NoneType' objects
This problem is also present in Spacewalk - thou code is a bit different - in Satellite there is check for --server setting and in case there is none, localhost is set. This however does not work, since it is set in function and not in global variable. Also server variable is later reset.
In Spacewalk there is no check, but there is idn_ascii_to_pune wrapper. This wrapper however does not change None variable, so None is passed futher into code.
Created attachment 516843 [details]
Patch for the problem.
This patch simply checks wheter there is --server parameter send and write error message and ends program in case there is not.
From the spacewalk-create-channel man page:
The hostname or IP address of the Satellite or Spacewalk server
to connect to. Defaults to localhost.
Martin, wouldn't it be possible to keep defaults to localhost?
Is there any external reason to change the defaults?
There is some inconsistency in that - Sat version tries to default to localhost (and fails), but Spacewalk won't even try. Don't know why the change was made to Sat version and not in upstream.
Found where the real problem is in Sat. This is not a bug. Closing.