rel-eng/packages/spacewalk-utils | 2 +-
utils/cloneByDate.py | 24 ++++++++++++++++++------
utils/spacewalk-clone-by-date | 5 ++++-
utils/spacewalk-clone-by-date.sgml | 9 +++++++++
utils/spacewalk-utils.spec | 5 ++++-
5 files changed, 36 insertions(+), 9 deletions(-)
New commits:
commit 37d57748ea8f8b273111738b932f71d74c08e642
Author: Stephen Herr <sherr(a)redhat.com>
Date: Fri Jul 6 14:01:36 2012 -0400
Automatic commit of package [spacewalk-utils] release [1.8.21-1].
diff --git a/rel-eng/packages/spacewalk-utils b/rel-eng/packages/spacewalk-utils
index 8ea3623..ee505c7 100644
--- a/rel-eng/packages/spacewalk-utils
+++ b/rel-eng/packages/spacewalk-utils
@@ -1 +1 @@
-1.8.20-1 utils/
+1.8.21-1 utils/
diff --git a/utils/spacewalk-utils.spec b/utils/spacewalk-utils.spec
index 215ec05..479160a 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.8.20
+Version: 1.8.21
Release: 1%{?dist}
Summary: Utilities that may be run against a Spacewalk server.
@@ -86,6 +86,9 @@ spacewalk-pylint $RPM_BUILD_ROOT%{rhnroot}
%changelog
+* Fri Jul 06 2012 Stephen Herr <sherr(a)redhat.com> 1.8.21-1
+- 838131 - spacewalk-clone-by-date can clone only security errata
+
* Thu Jun 14 2012 Michael Mraka <michael.mraka(a)redhat.com> 1.8.20-1
- system.list_user_systems() now returns localtime
commit 1986c8a6ca64545c8f711d78e4e189f567c25694
Author: Stephen Herr <sherr(a)redhat.com>
Date: Fri Jul 6 14:01:29 2012 -0400
838131 - spacewalk-clone-by-date can clone only security errata
diff --git a/utils/cloneByDate.py b/utils/cloneByDate.py
index adbe328..2497245 100644
--- a/utils/cloneByDate.py
+++ b/utils/cloneByDate.py
@@ -134,7 +134,9 @@ def main(options):
needed_channels = []
for channel_list in options.channels:
tree_cloner = ChannelTreeCloner(channel_list, xmlrpc, db,
- options.to_date, options.blacklist,
options.removelist, options.background)
+ options.to_date, options.blacklist,
+ options.removelist, options.background,
+ options.security_only)
cloners.append(tree_cloner)
needed_channels += tree_cloner.needing_create().values()
@@ -177,14 +179,16 @@ def main(options):
class ChannelTreeCloner:
"""Usage:
- a = ChannelTreeCloner(channel_hash, xmlrpc, db, to_date, blacklist)
+ a = ChannelTreeCloner(channel_hash, xmlrpc, db, to_date, blacklist,
+ removelist, detached, security_only)
a.create_channels()
a.prepare()
a.clone()
"""
# pylint: disable=R0902
def __init__(self, channels, remote_api, db_api, to_date, blacklist,
- removelist, detached):
+ removelist, detached,
+ security_only):
self.remote_api = remote_api
self.db_api = db_api
self.channel_map = channels
@@ -196,12 +200,14 @@ class ChannelTreeCloner:
self.src_parent = None
self.channel_details = None
self.detached = detached
+ self.security_only = security_only
self.validate_source_channels()
for from_label in self.ordered_labels():
to_label = self.channel_map[from_label]
cloner = ChannelCloner(from_label, to_label, self.to_date,
- self.remote_api, self.db_api, self.detached)
+ self.remote_api, self.db_api, self.detached,
+ self.security_only)
self.cloners.append(cloner)
@@ -384,7 +390,8 @@ class ChannelTreeCloner:
class ChannelCloner:
# pylint: disable=R0902
- def __init__(self, from_label, to_label, to_date, remote_api, db_api, detached):
+ def __init__(self, from_label, to_label, to_date, remote_api, db_api,
+ detached, security_only):
self.remote_api = remote_api
self.db_api = db_api
self.from_label = from_label
@@ -396,6 +403,7 @@ class ChannelCloner:
self.new_pkg_hash = {}
self.old_pkg_hash = {}
self.detached = detached
+ self.security_only = security_only
def dest_label(self):
@@ -509,7 +517,11 @@ class ChannelCloner:
for err in available_errata:
if err['issue_date'].date() <= self.to_date.date():
- to_clone.append(err)
+ if self.security_only:
+ if err['advisory_type'] == 'Security Advisory':
+ to_clone.append(err)
+ else:
+ to_clone.append(err)
return (to_clone, available_errata)
diff --git a/utils/spacewalk-clone-by-date b/utils/spacewalk-clone-by-date
index e919453..6b1b775 100755
--- a/utils/spacewalk-clone-by-date
+++ b/utils/spacewalk-clone-by-date
@@ -40,6 +40,7 @@ SAMPLE_CONFIG = """
"assumeyes":true,
"to_date": "2011-10-01",
"skip_depsolve":false,
+ "security_only":false,
"blacklist": {
"ALL":["sendmail"],
"my-rhel5-x86_64-clone":["emacs"],
@@ -80,7 +81,8 @@ def merge_config(options):
#if soemthing is in the config and not passed in as an argument
# add it to options
overwrite = ["username", "password", "blacklist",
"removelist", "channels",
- "server", "assumeyes", "to_date",
"skip_depsolve"]
+ "server", "assumeyes", "to_date",
"skip_depsolve",
+ "security_only"]
for key in overwrite:
if config.has_key(key) and not getattr(options, key):
setattr(options, key, config[key])
@@ -134,6 +136,7 @@ def parse_args():
parser.add_option("-k", "--skip_depsolve",
dest='skip_depsolve', action='store_true', help="Skip all dependency
solving (Not recommended).")
parser.add_option("-v", "--validate", dest='validate',
action='store_true', help="Run repoclosure on the set of specified
repositories.")
parser.add_option("-g", "--background",
dest='background', action='store_true', help="Clone the errata in the
background. Prompt will return quicker; before cloning is finished.")
+ parser.add_option("-o", "--security_only",
dest='security_only', action='store_true', help="Only clone security
errata (and their dependencies).")
(options, args) = parser.parse_args()
diff --git a/utils/spacewalk-clone-by-date.sgml b/utils/spacewalk-clone-by-date.sgml
index 12c4391..a70217f 100644
--- a/utils/spacewalk-clone-by-date.sgml
+++ b/utils/spacewalk-clone-by-date.sgml
@@ -64,6 +64,9 @@ Utility for cloning errata by date.
<arg>-y</arg><arg> --assumeyes </arg>
</cmdsynopsis>
<cmdsynopsis>
+ <arg>-o</arg><arg> --security_only </arg>
+ </cmdsynopsis>
+ <cmdsynopsis>
<arg>-g</arg><arg> --background</arg>
</cmdsynopsis>
<cmdsynopsis>
@@ -138,6 +141,12 @@ Utility for cloning errata by date.
</listitem>
</varlistentry>
<varlistentry>
+ <term> -o --security_only</term>
+ <listitem>
+ <para>Clone only security errata (and their
dependencies).</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term> -v --validate</term>
<listitem>
<para>Run repoclosure on all provided channels. This overrides
--to_date and will not perform any cloning.</para>