Bug 956684 - spacewalk-clone-by-date tracebacks when there are out of bounds numbers in date
Summary: spacewalk-clone-by-date tracebacks when there are out of bounds numbers in date
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.10
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space20
TreeView+ depends on / blocked
 
Reported: 2013-04-25 12:41 UTC by Martin Minar
Modified: 2016-07-04 00:57 UTC (History)
2 users (show)

Fixed In Version: spacewalk-utils-1.10.5-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-02 13:07:30 UTC
Embargoed:


Attachments (Terms of Use)
Patch proposal (1.07 KB, patch)
2013-04-25 12:41 UTC, Martin Minar
no flags Details | Diff

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.


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