Bug 728440 - Running spacewalk-create-channel without -s option leads to traceback
Summary: Running spacewalk-create-channel without -s option leads to traceback
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 1.6
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space16
TreeView+ depends on / blocked
 
Reported: 2011-08-05 07:55 UTC by Martin Minar
Modified: 2016-07-04 00:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 728173
Environment:
Last Closed: 2011-08-05 10:08:57 UTC


Attachments (Terms of Use)
Patch for the problem. (1.00 KB, patch)
2011-08-05 08:01 UTC, Martin Minar
no flags Details | Diff

Description Martin Minar 2011-08-05 07:55:23 UTC
+++ 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):
spacewalk-remote-utils-1.0.2-7.el5sat

How reproducible:
Always

Steps to Reproduce:
1. spacewalk-create-channel --user=admin --version=5 --update=u6 --release=server --arch=x86_64 --destChannel=channel56
  
Actual results:
[root@XYZ ~]# spacewalk-create-channel --user=admin --version=5 --update=u6 --release=server --arch=x86_64 --destChannel=channel56
No server specified, defaulting to localhost.
Password: 
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 ?
    main()
  File "/usr/bin/spacewalk-create-channel", line 172, in main
    client = Server(proto + "://" + server + "/rpc/api")
TypeError: cannot concatenate 'str' and 'NoneType' objects


Expected results:
No traceback

Additional info:

Comment 1 Martin Minar 2011-08-05 07:59:02 UTC
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.

Comment 2 Martin Minar 2011-08-05 08:01:23 UTC
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.

Comment 3 Šimon Lukašík 2011-08-05 08:52:28 UTC
From the spacewalk-create-channel man page:

  -sSERVER, --server=SERVER
          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?

Comment 4 Martin Minar 2011-08-05 09:56:05 UTC
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.

Comment 5 Martin Minar 2011-08-05 10:08:57 UTC
Found where the real problem is in Sat. This is not a bug. Closing.


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