Bug 1395877

Summary: spacewalk-repo-sync crashes if you don't give it a "-c channel"
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: ServerAssignee: Tomáš Kašpárek <tkasparek>
Status: CLOSED CURRENTRELEASE QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 580CC: d.sinclair, galtukho, jdostal, lhellebr, tlestach
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: 1356067 Environment:
Last Closed: 2017-06-21 12:11:44 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: 1356067    
Bug Blocks: 1397178    

Description Jan Hutař 2016-11-16 21:17:36 UTC
We have tested (or attempted to test) bug like this when Spacewalk 2.6 was to be released. This is a clone of that bug to get it re-tested on Satellite 5.8.0. In some cases bug can be completely irrelevant (in such cases I suggest to close the bug as NOTABUG), in some cases it might be wise to take the bug as a note that something changed in a given area and we might want to sanity-test that area (and mark the bug as VERIFIED with "SanityOnly" keyword) and in some cases bug might be totally relevant to Satellite.



+++ This bug was initially created as a clone of Bug #1356067 +++

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.

--- Additional comment from Jiří Dostál on 2016-07-13 08:41:47 EDT ---

spacewalk.git e3862c88b646f0d199bb6635f32863e377cef3f7

--- Additional comment from Duncan Sinclair on 2016-07-14 05:04:19 EDT ---

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?

--- Additional comment from Lukáš Hellebrandt on 2016-11-15 08:26:55 EST ---

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 1 Lukáš Hellebrandt 2016-11-25 11:55:04 UTC
Verified with sat5.8 compose from 2016-11-21.

Used the same steps as for SW.