Bug 1004536

Summary: traceback "TypeError: cannot concatenate 'str' and 'NoneType' objects" in spacewalk-sync-setup when logging
Product: [Community] Spacewalk Reporter: Grant Gainey <ggainey>
Component: ClientsAssignee: Grant Gainey <ggainey>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: medium    
Version: 2.1CC: cperry, jhutar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1001615 Environment:
Last Closed: 2017-10-03 19:07:35 UTC Type: Bug
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: 1001615, 1458440    
Bug Blocks:    

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 ***