Bug 728440

Summary: Running spacewalk-create-channel without -s option leads to traceback
Product: [Community] Spacewalk Reporter: Martin Minar <mminar>
Component: ClientsAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED NOTABUG QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: low    
Version: 1.6CC: jpazdziora, mkoci, slukasik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 728173 Environment:
Last Closed: 2011-08-05 10:08:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 723481    
Attachments:
Description Flags
Patch for the problem. none

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.