Bug 1356067 - spacewalk-repo-sync crashes if you don't give it a "-c channel"
Summary: spacewalk-repo-sync crashes if you don't give it a "-c channel"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.5
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jiří Dostál
QA Contact: Lukáš Hellebrandt
URL:
Whiteboard:
Depends On:
Blocks: 1395877 space27
TreeView+ depends on / blocked
 
Reported: 2016-07-13 11:02 UTC by Duncan Sinclair
Modified: 2017-09-27 19:14 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
: 1395877 (view as bug list)
Environment:
Last Closed: 2017-09-27 19:14:33 UTC
Embargoed:


Attachments (Terms of Use)

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


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