Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 956684

Summary: spacewalk-clone-by-date tracebacks when there are out of bounds numbers in date
Product: [Community] Spacewalk Reporter: Martin Minar <mminar>
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: low    
Version: 1.10CC: mkoci, tkasparek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-utils-1.10.5-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-02 13:07:30 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: 991452    
Attachments:
Description Flags
Patch proposal none

Description Martin Minar 2013-04-25 12:41:45 UTC
Created attachment 739872 [details]
Patch proposal

Description of problem:
Format of date in spacewalk-clone-by-date is in format YYYY-MM-DD - that one is tested, but when you give it number out of bounds - like 2011-12-32 - it will throw traceback.

Version-Release number of selected component (if applicable):
Nightly (also Satellite)

How reproducible:
Always

Steps to Reproduce:
1. spacewalk-clone-by-date -u user -p pass -d 2011-12-32 --channels=rhel-x86_64-server-6 clone_by_date_channel
  
Actual results:
Traceback (most recent call last):
  File "/usr/bin/spacewalk-clone-by-date", line 245, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/spacewalk-clone-by-date", line 234, in main
    args = parse_args();
  File "/usr/bin/spacewalk-clone-by-date", line 202, in parse_args
    options.to_date = parse_time(options.to_date)
  File "/usr/bin/spacewalk-clone-by-date", line 217, in parse_time
    return datetime.datetime(int(split[0]), int(split[1]), int(split[2]))
ValueError: day is out of range for month

Expected results:
User friendly error.

Additional info:
Patch is in attachment.

Comment 1 Michael Mráka 2013-04-26 08:04:32 UTC
Fixed in spacewalk master by
commit fe211544deb5fc92f8b34de3f2e3dad42c8068ac
    956684 - don't print traceback on invalid date

Comment 2 Tomáš Kašpárek 2013-08-02 13:07:30 UTC
Fix for this bug is present in Spacewalk 2.0, closing this bug as CURRENTRELEASE.