Bug 866930

Summary: spacewalk-clone-by-date without --to_date option produces traceback
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: ClientAssignee: Michael Mráka <mmraka>
Status: CLOSED ERRATA QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 550CC: dyordano
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-utils-1.7.15-42-sat Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-18 13:47:07 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: 819027    

Description Jan Hutař 2012-10-16 10:49:40 UTC
Description of problem:
When you run spacewalk-clone-by-date without specifying starting date, it tracebacks with error which is not helpful to the user.


Version-Release number of selected component (if applicable):
spacewalk-utils-1.7.15-37.el6sat.noarch
(same issue on Sat541 and in current SWnightly)


How reproducible:
always


Steps to Reproduce:
1. # spacewalk-clone-by-date -u <user> -p <nimda> -s $( hostname ) -l <some_channel> <new_channel>


Actual results:
# spacewalk-clone-by-date -u <user> -p <nimda> -s $( hostname ) -l <some_channel> <new_channel>
Traceback (most recent call last):
  File "/usr/bin/spacewalk-clone-by-date", line 209, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/spacewalk-clone-by-date", line 198, in main
    args = parse_args();
  File "/usr/bin/spacewalk-clone-by-date", line 166, in parse_args
    options.to_date = parse_time(options.to_date)
  File "/usr/bin/spacewalk-clone-by-date", line 179, in parse_time
    if re.match('[0-9]{4}-[0-9]{2}-[0-9]{2}',time_str):
  File "/usr/lib64/python2.7/re.py", line 137, in match
    return _compile(pattern, flags).match(string)
TypeError: expected string or buffer


Expected results:
Error saying I do not have specified "--to_date".

Comment 1 Michael Mráka 2012-12-05 14:19:33 UTC
Fixed in spacewalk master by
commit 414b6bd09d271ec0364aa159af350ba487f9e939
    866930 - do not traceback when called without --to_date

Comment 4 Stephen Herr 2013-01-09 19:48:48 UTC
and 4c21c742bb41d326284118fc0532fb330a24b04a

I was encountering an exception when not including --to_date that I have fixed. I also updated the documentation to make it more clear what happens if you don't include --to_date.

Comment 7 errata-xmlrpc 2013-01-18 13:47:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0167.html