Bug 1004536 - traceback "TypeError: cannot concatenate 'str' and 'NoneType' objects" in spacewalk-sync-setup when logging
traceback "TypeError: cannot concatenate 'str' and 'NoneType' objects" in spa...
Status: NEW
Product: Spacewalk
Classification: Community
Component: Clients (Show other bugs)
2.1
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Grant Gainey
Red Hat Satellite QA List
:
Depends On: 1001615
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-04 17:31 EDT by Grant Gainey
Modified: 2013-10-13 17:11 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1001615
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Grant Gainey 2013-09-04 17:31:38 EDT
+++ This bug was initially created as a clone of Bug #1001615 +++

Description of problem:
I was playing with spacewalk-sync-setup and observed a traceback.


How reproducible:
always


Steps to Reproduce:
1. # spacewalk-sync-setup --ct --ss=<fqdn> --sl=<user> --sp=<pass>


Actual results:
Traceback (most recent call last):
  File "/usr/bin/spacewalk-sync-setup", line 610, in <module>
    master_cnx = connectTo(master_info)
  File "/usr/bin/spacewalk-sync-setup", line 299, in connectTo
    logging.info("Connecting to " + info['login'] + "@" + info['fqdn'])
TypeError: cannot concatenate 'str' and 'NoneType' objects

I believe this attempts to say me I have not provided master login info (server/user/pass), so maybe this is related or might be treated as similar issue falling into "insufficient input options verification" description:

# spacewalk-sync-setup --ct
Traceback (most recent call last):
  File "/usr/bin/spacewalk-sync-setup", line 605, in <module>
    config = setupConfig(options)
  File "/usr/bin/spacewalk-sync-setup", line 207, in setupConfig
    initializeConfig(opt, handle)
  File "/usr/bin/spacewalk-sync-setup", line 142, in initializeConfig
    hdr = hdr.replace('SLAVE', opt.slave)
TypeError: expected a character buffer object


Expected results:
There should be no traceback.
Comment 1 Grant Gainey 2013-09-04 17:54:32 EDT
Need to think about, at startup, "what do we have" and "what are we being asked to do".  Because the user can specify on the command-line, in config-files, or both, the answer can be complicated.

Considerations:

* What do we need to connect to master for?
  * Create master-template file
  * Create slave-template file
  * Apply change to master

* What do we need to connect to slave for?
  * Create slave-template file
  * Apply change to slave

* What are we being asked to do?
  * Create template(s)?
  * dry-run changes?
  * apply changes?
  * get CA-CERT?

We definitely need to add a validateAvailableInput(options, config) method that can look at what the app has available and what it's being asked to do, and produce human-useful error codes.

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