rel-eng/packages/spacewalk-utils | 2 +-
utils/spacewalk-clone-by-date | 8 ++++++--
utils/spacewalk-utils.spec | 5 ++++-
3 files changed, 11 insertions(+), 4 deletions(-)
New commits:
commit 721fad220fa14dbb5eaa68c57882787b601068f3
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Apr 26 10:03:12 2013 +0200
Automatic commit of package [spacewalk-utils] release [1.10.5-1].
diff --git a/rel-eng/packages/spacewalk-utils b/rel-eng/packages/spacewalk-utils
index 1713777..686e00f 100644
--- a/rel-eng/packages/spacewalk-utils
+++ b/rel-eng/packages/spacewalk-utils
@@ -1 +1 @@
-1.10.4-1 utils/
+1.10.5-1 utils/
diff --git a/utils/spacewalk-utils.spec b/utils/spacewalk-utils.spec
index a25e20d..241e29f 100644
--- a/utils/spacewalk-utils.spec
+++ b/utils/spacewalk-utils.spec
@@ -1,7 +1,7 @@
%define rhnroot %{_prefix}/share/rhn
Name: spacewalk-utils
-Version: 1.10.4
+Version: 1.10.5
Release: 1%{?dist}
Summary: Utilities that may be run against a Spacewalk server.
@@ -88,6 +88,9 @@ spacewalk-pylint $RPM_BUILD_ROOT%{rhnroot}
%changelog
+* Fri Apr 26 2013 Michael Mraka <michael.mraka(a)redhat.com> 1.10.5-1
+- 956684 - don't print traceback on invalid date
+
* Mon Apr 08 2013 Stephen Herr <sherr(a)redhat.com> 1.10.4-1
- 948605 - fixing pylint error
commit fe211544deb5fc92f8b34de3f2e3dad42c8068ac
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Apr 26 10:00:41 2013 +0200
956684 - don't print traceback on invalid date
diff --git a/utils/spacewalk-clone-by-date b/utils/spacewalk-clone-by-date
index 04776e6..dd48729 100755
--- a/utils/spacewalk-clone-by-date
+++ b/utils/spacewalk-clone-by-date
@@ -215,8 +215,12 @@ def parse_time(time_str):
We need to use datetime, but python 2.4 does not support strptime(), so we have to parse ourselves
"""
if re.match('[0-9]{4}-[0-9]{2}-[0-9]{2}',time_str):
- split = time_str.split("-")
- return datetime.datetime(int(split[0]), int(split[1]), int(split[2]))
+ try:
+ split = time_str.split("-")
+ date = datetime.datetime(int(split[0]), int(split[1]), int(split[2]))
+ except:
+ raise UserError("Invalid date (%s)" % time_str)
+ return date
else:
raise UserError("Invalid date format (%s), expected YYYY-MM-DD" % time_str)