backend/satellite_tools/disk_dumper/iss.py | 15 ++++++++--
backend/satellite_tools/disk_dumper/iss_ui.py | 4 +-
backend/satellite_tools/disk_dumper/rhn-satellite-exporter.sgml | 8 ++++-
3 files changed, 21 insertions(+), 6 deletions(-)
New commits:
commit 537985d68fa417decfc1ced913bdc76b83b05c7b
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Sep 24 17:06:54 2010 +0200
637155 - pad --start-date, --end-date with zeros
when date is something between of YYYYMMDD and YYYYMMDDHH24MI, then pad it from right
with zeroes
diff --git a/backend/satellite_tools/disk_dumper/iss.py
b/backend/satellite_tools/disk_dumper/iss.py
index c753a86..6e02afd 100644
--- a/backend/satellite_tools/disk_dumper/iss.py
+++ b/backend/satellite_tools/disk_dumper/iss.py
@@ -32,6 +32,9 @@ import shutil
import iss_isos
from spacewalk.common.checksum import getFileChecksum
+import gettext
+_ = gettext.gettext
+
class ISSError(Exception):
def __init__(self, msg, tb):
self.msg = msg
@@ -959,13 +962,21 @@ class ExporterMain:
sys.stderr.write("--end-date must be used with --start-date.")
sys.exit(1)
+ if self.options.end_date and len(self.options.end_date) < 8:
+ sys.stdout.write(_("format of %s should be at least YYYYMMDD.\n") %
'--end-date')
+ sys.exit(1)
+
+ if self.options.start_date and len(self.options.start_date) < 8:
+ sys.stdout.write(_("format of %s should be at least YYYYMMDD.\n") %
'--start-date')
+ sys.exit(1)
+
if self.options.start_date:
if self.options.end_date is None:
self.end_date = time.strftime("%Y%m%d%H%M%S")
else:
- self.end_date = self.options.end_date
+ self.end_date = self.options.end_date.ljust(14, '0')
- self.start_date = self.options.start_date
+ self.start_date = self.options.start_date.ljust(14, '0')
print "start date limit: %s" % self.start_date
print "end date limit: %s" % self.end_date
# set the limits to pick right queries in dumper
diff --git a/backend/satellite_tools/disk_dumper/iss_ui.py
b/backend/satellite_tools/disk_dumper/iss_ui.py
index ea0ca60..433a1e2 100644
--- a/backend/satellite_tools/disk_dumper/iss_ui.py
+++ b/backend/satellite_tools/disk_dumper/iss_ui.py
@@ -33,9 +33,9 @@ class UI:
option("-c", "--channel",
action="append",
help="Include this channel in the export."),
option( "--start-date", action="store",
- help="The start date limit that the last modified dates are compared
against. Must be in the format 'YYYYMMDDHH24MISS'."),
+ help="The start date limit that the last modified dates are compared
against. Should be in the format 'YYYYMMDDHH24MISS'."),
option( "--end-date", action="store",
- help="The end date limit that the last modified dates are compared against.
Must be in the format 'YYYYMMDDHH24MISS'."),
+ help="The end date limit that the last modified dates are compared against.
Should be in the format 'YYYYMMDDHH24MISS'."),
option( "--make-isos", action="store",
help="Create channel dump isos a directory called satellite-isos. Usage:
--make-isos=cd or dvd"),
option("-p", "--print-configuration",
action="store_true", default=0,
diff --git a/backend/satellite_tools/disk_dumper/rhn-satellite-exporter.sgml
b/backend/satellite_tools/disk_dumper/rhn-satellite-exporter.sgml
index 7de6222..8dfd981 100644
--- a/backend/satellite_tools/disk_dumper/rhn-satellite-exporter.sgml
+++ b/backend/satellite_tools/disk_dumper/rhn-satellite-exporter.sgml
@@ -128,14 +128,18 @@ A tool that exports satellite content into a directory in an XML
format. That co
<term>--start-date=<replaceable>START_DATE</replaceable></term>
<listitem>
<para>The start date limit that the last modified dates are
- compared against. Must be in the format
'YYYYMMDDHH24MISS'.</para>
+ compared against. Should be in the format 'YYYYMMDDHH24MISS'.
+ If you did not enter hour, minute and/or second, then zero is
+ assumed. I.e. date 20100101 is expanded to
20100101000000.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--end-date=<replaceable>END_DATE</replaceable></term>
<listitem>
<para>The end date limit that the last modified dates are
- compared against. Must be in the format
'YYYYMMDDHH24MISS'.</para>
+ compared against. Must be in the format 'YYYYMMDDHH24MISS'.
+ If you did not enter hour, minute and/or second, then zero is
+ assumed. I.e. date 20100101 is expanded to
20100101000000.</para>
</listitem>
</varlistentry>
<varlistentry>
Show replies by date