Bug 1356067

Summary: spacewalk-repo-sync crashes if you don't give it a "-c channel"
Product: [Community] Spacewalk Reporter: Duncan Sinclair <d.sinclair>
Component: ServerAssignee: Jiří Dostál <jdostal>
Status: CLOSED CURRENTRELEASE QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.5CC: eherget, galtukho, jdostal, lhellebr
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1395877 (view as bug list) Environment:
Last Closed: 2017-09-27 19:14:33 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:    
Bug Blocks: 1395877, 1484117    

Description Duncan Sinclair 2016-07-13 11:02:20 UTC
Description of problem:
Running spacewalk-repo-sync without a "-c" channel option causes it to fail.

Version-Release number of selected component (if applicable):
Python 2.7.5
CentOS 7

How reproducible:
Every time

Steps to Reproduce:
1. Create a spacewalk-repo-sync config file
2. Run "spacewalk-repo-sync -g spacewalk-repo-sync.config
3. Don't add any "-c channel" argument

Actual results:
Traceback (most recent call last):
  File "/usr/bin/spacewalk-repo-sync", line 219, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/spacewalk-repo-sync", line 161, in main
    if len(options.channel_label)>0:
TypeError: object of type 'NoneType' has no len()


Expected results:
Syncing all the channels specified in the config file.

Additional info:
This bug seems to be the result of the recent enhancement to spacewalk-repo-sync to allow it to accept multiple "-c" arguments.

Comment 1 Jiří Dostál 2016-07-13 12:41:47 UTC
spacewalk.git e3862c88b646f0d199bb6635f32863e377cef3f7

Comment 2 Duncan Sinclair 2016-07-14 09:04:19 UTC
Sorry, must have missed that commit when I was looking yesterday.

Feel free to close this bug.

Can I suggest a 2.5.1 release to stop more people stumbling over this?

Comment 3 Lukáš Hellebrandt 2016-11-15 13:26:55 UTC
Verified with SW nightly from 2016-11-14.

Used reproducer from OP:

# cat srs.conf
{
        "no_errata":true,
        "sync_kickstart":false,
        "fail":true,
        "dry_run":false,
        "channel":{"testchan":["https://ftp-stud.hs-esslingen.de/pub/fedora/linux/development/rawhide/Workstation/x86_64/os/"]},
        "parent_channel":[]
}
# spacewalk-repo-sync -g srs.conf
[...]
# echo $?
0

Comment 4 Eric Herget 2017-09-27 19:14:33 UTC
This looks like it was fixed in previous release, but I'm closing it in this one.

Spacewalk 2.7 has been released.

https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes27