backend/satellite_tools/spacewalk-remove-channel | 20 ++-
backend/satellite_tools/spacewalk-remove-channel.sgml | 119 ++++++++++++++++++
backend/spacewalk-backend.spec | 2
3 files changed, 137 insertions(+), 4 deletions(-)
New commits:
commit f96836102393a37b44721b14068aab4a1015b653
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Feb 17 18:05:28 2010 -0500
adding repo deletion to channel remove script
diff --git a/backend/satellite_tools/spacewalk-remove-channel
b/backend/satellite_tools/spacewalk-remove-channel
index 2407fd4..c848327 100755
--- a/backend/satellite_tools/spacewalk-remove-channel
+++ b/backend/satellite_tools/spacewalk-remove-channel
@@ -20,7 +20,7 @@
import sys
import string
import os
-
+import shutil
from optparse import Option, OptionParser
@@ -315,6 +315,16 @@ def delete_channels(channelLabels, force=0, justdb=0):
h = rhnSQL.prepare(query % (table, field))
h.executemany(channel_id=channel_ids)
+ __deleteRepoData(channelLabels)
+
+
+def __deleteRepoData(labels):
+ dir = '/var/cache/' + CFG.repomd_path_prefix
+ for label in labels:
+ if os.path.isdir(dir + '/' + label):
+ shutil.rmtree(dir + '/' + label)
+
+
def list_packages(channelLabels, sources=0, force=0):
"List the source ids for the channels"
if sources:
commit 58f8d0a76c8d8d13d3ce7b742a44e30fe4d41172
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Feb 17 16:28:48 2010 -0500
fixing small typo in man page
diff --git a/backend/satellite_tools/spacewalk-remove-channel.sgml
b/backend/satellite_tools/spacewalk-remove-channel.sgml
index f3ecc68..e8371f7 100644
--- a/backend/satellite_tools/spacewalk-remove-channel.sgml
+++ b/backend/satellite_tools/spacewalk-remove-channel.sgml
@@ -6,7 +6,7 @@
<refentry>
<RefMeta>
-<RefEntryTitle>spaceawlk-remove-channel</RefEntryTitle><manvolnum>8</manvolnum>
+<RefEntryTitle>spacewalk-remove-channel</RefEntryTitle><manvolnum>8</manvolnum>
<RefMiscInfo>Version 3.5.0</RefMiscInfo>
</RefMeta>
commit ab86f4d0a9be6adb94c92913b4a0b777ee0e6225
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Feb 17 11:54:44 2010 -0500
updating spec file to include man page for spacewalk-remove-channel
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index c60cec7..2c8aae9 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -598,7 +598,7 @@ rm -f %{rhnconf}/rhnSecret.py*
%{_mandir}/man8/spacewalk-debug.8*
%{_mandir}/man8/satpasswd.8*
%{_mandir}/man8/satwho.8*
-
+%{_mandir}/man8/spacewalk-remove-channel.8*
%files xml-export-libs
%defattr(-,root,root)
commit b58563862315442921edd8c10d341f2a6806a2bb
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Feb 17 11:52:15 2010 -0500
updating spacewalk-remove-channel and adding man page
diff --git a/backend/satellite_tools/spacewalk-remove-channel
b/backend/satellite_tools/spacewalk-remove-channel
index 706049a..2407fd4 100755
--- a/backend/satellite_tools/spacewalk-remove-channel
+++ b/backend/satellite_tools/spacewalk-remove-channel
@@ -72,7 +72,11 @@ def main():
dict_label, dict_parents = __listChannels()
if options.list:
+ lbls = []
for c in dict_label.keys():
+ lbls.append(c)
+ lbls.sort()
+ for c in lbls:
print c
return
@@ -294,6 +298,7 @@ def delete_channels(channelLabels, force=0, justdb=0):
tables = [
['rhnErrataFileChannel', 'channel_id'],
+ ['rhnErrataNotificationQueue', 'channel_id'],
['rhnChannelErrata', 'channel_id'],
['rhnChannelFamilyMembers', 'channel_id'],
['rhnChannelPackage', 'channel_id'],
diff --git a/backend/satellite_tools/spacewalk-remove-channel.sgml
b/backend/satellite_tools/spacewalk-remove-channel.sgml
new file mode 100644
index 0000000..f3ecc68
--- /dev/null
+++ b/backend/satellite_tools/spacewalk-remove-channel.sgml
@@ -0,0 +1,119 @@
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
+<!ENTITY RHNSAT "RHN Satellite Server" >
+<!ENTITY RHNCHANRM "Spacewalk Channel Removal tool" >
+
+]>
+<refentry>
+
+<RefMeta>
+<RefEntryTitle>spaceawlk-remove-channel</RefEntryTitle><manvolnum>8</manvolnum>
+<RefMiscInfo>Version 3.5.0</RefMiscInfo>
+</RefMeta>
+
+<RefNameDiv>
+<RefName><command>spaceawlk-remove-channel</command></RefName>
+<RefPurpose>
+Removes a channel from an RHN Satellite or Spacewalk server.
+</RefPurpose>
+</RefNameDiv>
+
+<RefSynopsisDiv>
+<Synopsis>
+ <cmdsynopsis>
+ <command>spaceawlk-remove-channel</command>
+ <arg>options <replaceable>...</replaceable></arg>
+ <arg>-c<replaceable>CHANNEL_LABEL</replaceable></arg>
+
<arg>--mount-point=<replaceable>CHANNEL_LABEL</replaceable></arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <arg>-u</arg> <arg>--unsubscribe</arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <arg>-l</arg>
+ <arg>--list</arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <arg>--justdb</arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <arg>-v</arg> <arg>--verbose</arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
+ <arg>--force</arg>
+ </cmdsynopsis>
+</Synopsis>
+</RefSynopsisDiv>
+
+<RefSect1><Title>Description</Title>
+<para>
+ The <emphasis>spacewalk-channel-remove</emphasis> completely removes
+ channels (even Red Hat supplied ones) from a RHN Satellite or Spacewalk server.
+</para>
+<para>
+ By default systems are not unsubscribed from the specified channel(s). If systems
+ are currently subcribed, they will be listed. To unsubscribe these systems, simply
+ use the --unsubscribe option.
+</para>
+</RefSect1>
+
+<RefSect1><Title>Options</Title>
+<variablelist>
+ <varlistentry>
+ <term>-h, --help</term>
+ <listitem>
+ <para>Display the help screen with a list of options.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>-l, --list</term>
+ <listitem>
+ <para>List all channels on the satellite.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>-u, --unsubscribe</term>
+ <listitem>
+ <para>Unsubscribe any systems subscribed to the specified
channels.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>--justdb</term>
+ <listitem>
+ <para>Don't remove any files from the file system. Instead only
delete metadata from the database.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>-c<replaceable>CHANNEL</replaceable>,
+ --channel=<replaceable>CHANNEL</replaceable></term>
+ <listitem>
+ <para>Delete the channel with the specified label. May be used
multiple times to specify multiple channels.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>--force</term>
+ <listitem>
+ <para>Delete packages from the satellite even if the package is in more
channels than what is specified. (Not Recommended)</para>
+ </listitem>
+ </varlistentry>
+</variablelist>
+</RefSect1>
+
+<RefSect1><Title>Examples</Title>
+<simplelist>
+ <member><command>spacewalk-remove-channel
--list</command></member>
+ <member><command>spacewalk-remove-channel
--channel=rhel-i386-as-3</command></member>
+</simplelist>
+</RefSect1>
+
+<RefSect1><Title>Authors</Title>
+<simplelist>
+ <member>Todd Warner <email>taw(a)redhat.com</email></member>
+ <member>Mihai Ibanescu
<email>misa(a)redhat.com</email></member>
+ <member>Justin Sherrill
<email>jsherril(a)redhat.com</email></member>
+</simplelist>
+</RefSect1>
+</RefEntry>
+
+<!--
+vim: sw=4
+-->
commit cf5971d42592b9852a15e9a3772e72140071fcf3
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed Feb 17 10:00:19 2010 -0500
few fixes for spacewalk-remove-channel
diff --git a/backend/satellite_tools/spacewalk-remove-channel
b/backend/satellite_tools/spacewalk-remove-channel
old mode 100644
new mode 100755
index af06ba3..706049a
--- a/backend/satellite_tools/spacewalk-remove-channel
+++ b/backend/satellite_tools/spacewalk-remove-channel
@@ -21,7 +21,6 @@ import sys
import string
import os
-from progress_bar import ProgressBar
from optparse import Option, OptionParser
@@ -30,6 +29,7 @@ _LIBPATH = "/usr/share/rhn"
if _LIBPATH not in sys.path:
sys.path.append(_LIBPATH)
+from satellite_tools.progress_bar import ProgressBar
from common import CFG, initCFG, initLOG, log_debug, log_error
from server import rhnSQL
@@ -50,7 +50,6 @@ options_table = [
def main():
- print UNSUPPORTED_WARN
global options_table
parser = OptionParser(option_list=options_table)