backend/satellite_tools/disk_dumper/iss.py | 23 ++++++++--
backend/satellite_tools/disk_dumper/iss_ui.py | 2
backend/satellite_tools/disk_dumper/rhn-satellite-exporter.sgml | 11 ++++
3 files changed, 33 insertions(+), 3 deletions(-)
New commits:
commit d53e2196a45c38fffbd97738c429cf883bdd5f79
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Jun 20 10:06:43 2011 +0200
676937 - allow to export all channels
diff --git a/backend/satellite_tools/disk_dumper/iss.py
b/backend/satellite_tools/disk_dumper/iss.py
index a2634de..429d062 100644
--- a/backend/satellite_tools/disk_dumper/iss.py
+++ b/backend/satellite_tools/disk_dumper/iss.py
@@ -908,12 +908,18 @@ class ExporterMain:
sys.exit(0)
if self.options.list_channels:
- self.list_channels()
+ self.print_list_channels()
sys.exit(0)
#From this point on everything should assume a list of channels, so it needs to
be a list
#even if there's only one entry.
- if self.options.channel:
+ if self.options.all_channels:
+ channel_dict = self.list_channels()
+ self.options.channel = []
+ for pc in channel_dict.keys():
+ self.options.channel.append(pc)
+ self.options.channel.extend(channel_dict[pc])
+ elif self.options.channel:
if type(self.options.channel) != type([]):
self.options.channel = [self.options.channel]
else:
@@ -989,6 +995,11 @@ class ExporterMain:
sys.exit(-1)
def list_channels(self):
+ """ return all available channels
+
+ the returned format is dictionary containing base_label as keys and value is
list
+ of labels of child channels
+ """
#The keys for channel_dict are the labels of the base channels.
#The values associated with each key is a list of the labels of
#the child channels whose parent channel is the key.
@@ -1035,7 +1046,13 @@ class ExporterMain:
for child in child_channels:
child_label = child['label']
channel_dict[base_label].append(child_label)
-
+ return channel_dict
+
+ def print_list_channels(self, channel_dict):
+ """ channel_dict is dictionary containing base_label as keys and
value is list
+ of labels of child channels
+ """
+ if channel_dict:
#Print the legend.
print "Channel List:"
print "B = Base Channel"
diff --git a/backend/satellite_tools/disk_dumper/iss_ui.py
b/backend/satellite_tools/disk_dumper/iss_ui.py
index e17f842..6d8ee7c 100644
--- a/backend/satellite_tools/disk_dumper/iss_ui.py
+++ b/backend/satellite_tools/disk_dumper/iss_ui.py
@@ -32,6 +32,8 @@ class UI:
help="List all of the steps that rhn-satellite-exporter takes while
exporting data. These can be used as values for --step"),
option("-c", "--channel",
action="append",
help="Include this channel in the export."),
+ option("-a", "--all-channels",
action="store_true", default=0,
+ help="Export all channels."),
option( "--start-date", action="store",
help="The start date limit that the last modified dates are compared
against. Should be in the format 'YYYYMMDDHH24MISS'."),
option( "--end-date", action="store",
diff --git a/backend/satellite_tools/disk_dumper/rhn-satellite-exporter.sgml
b/backend/satellite_tools/disk_dumper/rhn-satellite-exporter.sgml
index 8dfd981..4214458 100644
--- a/backend/satellite_tools/disk_dumper/rhn-satellite-exporter.sgml
+++ b/backend/satellite_tools/disk_dumper/rhn-satellite-exporter.sgml
@@ -33,6 +33,10 @@ A tool that exports satellite content into a directory in an XML
format. That co
<arg>--channel=<replaceable>CHANNEL_LABEL</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
+ <arg>-a</arg>
+ <arg>--all-channels</arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
<arg>--hard-links</arg>
</cmdsynopsis>
<cmdsynopsis>
@@ -125,6 +129,13 @@ A tool that exports satellite content into a directory in an XML
format. That co
</listitem>
</varlistentry>
<varlistentry>
+ <term>-a,
+ --all-channels</term>
+ <listitem>
+ <para>Export all channels.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term>--start-date=<replaceable>START_DATE</replaceable></term>
<listitem>
<para>The start date limit that the last modified dates are
Show replies by date