Bug 1004536 - traceback "TypeError: cannot concatenate 'str' and 'NoneType' objects" in spacewalk-sync-setup when logging
Summary: traceback "TypeError: cannot concatenate 'str' and 'NoneType' objects" in spa...
Keywords:
Status: CLOSED DUPLICATE of bug 1458440
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 2.1
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
Assignee: Grant Gainey
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On: 1001615 1458440
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-04 21:31 UTC by Grant Gainey
Modified: 2017-10-03 19:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1001615
Environment:
Last Closed: 2017-10-03 19:07:35 UTC
Embargoed:


Attachments (Terms of Use)

Description Grant Gainey 2013-09-04 21:31:38 UTC
+++ 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 21:54:32 UTC
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.

Comment 2 Grant Gainey 2017-10-03 19:07:35 UTC

*** This bug has been marked as a duplicate of bug 1458440 ***


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