backend/satellite_tools
by Michael Mraka
backend/satellite_tools/disk_dumper/iss.py | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
New commits:
commit b27ece681b37f19b3b5a6e43cc2ead7c1807c972
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Feb 24 13:46:04 2010 +0100
don't limit channel list on dates
there might be a valid data in the channel even if it was last synced
after end_time
diff --git a/backend/satellite_tools/disk_dumper/iss.py b/backend/satellite_tools/disk_dumper/iss.py
index e8133bd..3d70abd 100644
--- a/backend/satellite_tools/disk_dumper/iss.py
+++ b/backend/satellite_tools/disk_dumper/iss.py
@@ -175,11 +175,6 @@ class Dumper(dumper.XML_Dumper):
from rhnChannel ch
where ch.label = :label
"""
- if self.start_date:
- query += """
- and last_modified >= TO_DATE(:start_date, 'YYYYMMDDHH24MISS')
- and last_modified <= TO_DATE(:end_date, 'YYYYMMDDHH24MISS')
- """
self.channel_query = rhnSQL.Statement(query)
ch_data = rhnSQL.prepare(self.channel_query)
@@ -190,14 +185,11 @@ class Dumper(dumper.XML_Dumper):
#Channel_labels should be the list of channels passed into rhn-satellite-exporter by the user.
log2stdout(1, "Gathering channel info...")
for ids in channel_labels:
- ch_data.execute(label=ids, **dates)
+ ch_data.execute(label=ids)
ch_info = ch_data.fetchall_dict()
if not ch_info:
- if self.start_date:
- raise ISSError("Error: No %s channel information found within specified time frame." % ids, "")
- else:
- raise ISSError("Error: Channel %s not found." % ids, "")
+ raise ISSError("Error: Channel %s not found." % ids, "")
self.channel_ids = self.channel_ids + ch_info
13 years, 9 months
client/rhel
by Miroslav Suchý
client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit bb748540104fc834ead706bb6c4ac45659b6cd98
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Feb 24 10:42:44 2010 +0100
567901 - fix input of user name
do not write new line after the prompt Username:
strip new line from the user name
diff --git a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
index 968dd29..72aa70d 100644
--- a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
+++ b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
@@ -67,8 +67,8 @@ def processCommandline():
if args:
systemExit(1, "ERROR: these arguments make no sense in this context (try --help)")
if not OPTIONS.user and not OPTIONS.list:
- print("Username: ")
- OPTIONS.user = sys.stdin.readline()
+ print "Username: ",
+ OPTIONS.user = sys.stdin.readline().rstrip('\n')
if not OPTIONS.password and not OPTIONS.list:
OPTIONS.password = getpass.getpass()
13 years, 9 months
4 commits - java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchCobblerSystemRecordException.java | 58 ++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/ProfileHandler.java | 22 ++-
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 24 +++-
java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerVirtualSystemCommand.java | 8 -
4 files changed, 92 insertions(+), 20 deletions(-)
New commits:
commit 268907eb29b62d6ffd9c86af48c3cd2c9db4d79e
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Feb 23 21:15:33 2010 +0100
562881 - save cobbler object after setting kickstart variables
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/ProfileHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/ProfileHandler.java
index a5a9f6c..8f83e83 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/ProfileHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/ProfileHandler.java
@@ -52,6 +52,8 @@ import com.redhat.rhn.manager.kickstart.KickstartFormatter;
import com.redhat.rhn.manager.kickstart.KickstartIpCommand;
import com.redhat.rhn.manager.kickstart.KickstartOptionsCommand;
+import org.cobbler.Profile;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
@@ -1039,7 +1041,10 @@ public class ProfileHandler extends BaseHandler {
User loggedInUser = getLoggedInUser(sessionKey);
KickstartData ksData = lookupKsData(ksLabel, loggedInUser.getOrg());
- ksData.getCobblerObject(loggedInUser).setKsMeta(variables);
+ Profile profile = ksData.getCobblerObject(loggedInUser);
+ profile.setKsMeta(variables);
+ profile.save();
+
return 1;
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index 730c3ca..41f78b4 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -4251,6 +4251,8 @@ public class SystemHandler extends BaseHandler {
rec.enableNetboot(netboot);
rec.setKsMeta(variables);
+ rec.save();
+
return 1;
}
}
commit eb0ec53e6e9af526d64061a675604d2add332712
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Feb 23 13:40:32 2010 +0100
562881 - apidoc fixes
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/ProfileHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/ProfileHandler.java
index 45e7bdc..a5a9f6c 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/ProfileHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/ProfileHandler.java
@@ -993,10 +993,11 @@ public class ProfileHandler extends BaseHandler {
* @xmlrpc.param #param("string", "sessionKey")
* @xmlrpc.param #param("string", "ksLabel")
* @xmlrpc.returntype
- * #array("kickstart variables")
* #array()
- * #prop("string", "key")
- * #prop("string or int", "value")
+ * #struct("kickstart variable")
+ * #prop("string", "key")
+ * #prop("string or int", "value")
+ * #struct_end()
* #array_end()
*/
public Map<String, Object> getVariables(String sessionKey, String ksLabel) {
@@ -1023,10 +1024,12 @@ public class ProfileHandler extends BaseHandler {
*
* @xmlrpc.param #param("string", "sessionKey")
* @xmlrpc.param #param("string", "ksLabel")
- * @xmlrpc.param #param("array", "variables")
+ * @xmlrpc.param
* #array()
- * #prop("string", "key")
- * #prop("string or int", "value")
+ * #struct("kickstart variable")
+ * #prop("string", "key")
+ * #prop("string or int", "value")
+ * #struct_end()
* #array_end()
* @xmlrpc.returntype #return_int_success()
*/
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index a4aeb2d..730c3ca 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -4164,11 +4164,12 @@ public class SystemHandler extends BaseHandler {
* @xmlrpc.returntype
* #struct("System kickstart variables")
* #prop_desc("boolean" "netboot" "netboot enabled")
- * #prop_desc("array" "kickstart variables")
- * #array()
+ * #prop_array_begin("kickstart variables")
+ * #struct("kickstart variable")
* #prop("string", "key")
* #prop("string or int", "value")
- * #array_end()
+ * #struct_end()
+ * #prop_array_end()
* #struct_end()
*/
public Map getVariables(String sessionKey, Integer serverId) {
@@ -4215,10 +4216,12 @@ public class SystemHandler extends BaseHandler {
* @xmlrpc.param #param("string", "sessionKey")
* @xmlrpc.param #param("int", "serverId")
* @xmlrpc.param #param("boolean","netboot")
- * @xmlrpc.param #param("array", "kickstart variables")
+ * @xmlrpc.param
* #array()
- * #prop("string", "key")
- * #prop("string or int", "value")
+ * #struct("kickstart variable")
+ * #prop("string", "key")
+ * #prop("string or int", "value")
+ * #struct_end()
* #array_end()
* @xmlrpc.returntype #return_int_success()
*/
commit cdd1c75f89ab346e5eff998dc235096bf62ff23c
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Feb 23 11:55:34 2010 +0100
562881 - cobbler system record check
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchCobblerSystemRecordException.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchCobblerSystemRecordException.java
new file mode 100644
index 0000000..5da52fd
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchCobblerSystemRecordException.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2009--2010 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+
+package com.redhat.rhn.frontend.xmlrpc;
+
+import com.redhat.rhn.FaultException;
+
+/**
+ * no such cobbler system record
+ * <p>
+ *
+ *
+ * @version definition($Rev: 76724 $)/template($Rev: 67725 $)
+ */
+public class NoSuchCobblerSystemRecordException extends FaultException {
+
+ /**
+ * Comment for <code>serialVersionUID</code>
+ */
+ private static final long serialVersionUID = 4245255424549337483L;
+
+ /**
+ * Constructor
+ */
+ public NoSuchCobblerSystemRecordException() {
+ this("No such cobbler system record");
+ }
+
+ /**
+ * Constructor
+ * @param cause the cause (which is saved for later retrieval by the
+ * Throwable.getCause() method). (A null value is permitted, and indicates
+ * that the cause is nonexistent or unknown.)
+ */
+ public NoSuchCobblerSystemRecordException(Throwable cause) {
+ super(-214, "noSuchCobblerSystemRecord", "No such cobbler system record", cause);
+ }
+
+ /**
+ * Constructor
+ * @param message exception message
+ */
+ public NoSuchCobblerSystemRecordException(String message) {
+ super(-214, "noSuchCobblerSystemRecord", message);
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index c20b8b8..a4aeb2d 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -84,6 +84,7 @@ import com.redhat.rhn.frontend.xmlrpc.InvalidSystemException;
import com.redhat.rhn.frontend.xmlrpc.MethodInvalidParamException;
import com.redhat.rhn.frontend.xmlrpc.NoSuchActionException;
import com.redhat.rhn.frontend.xmlrpc.NoSuchChannelException;
+import com.redhat.rhn.frontend.xmlrpc.NoSuchCobblerSystemRecordException;
import com.redhat.rhn.frontend.xmlrpc.NoSuchPackageException;
import com.redhat.rhn.frontend.xmlrpc.NoSuchSystemException;
import com.redhat.rhn.frontend.xmlrpc.NotEnoughEntitlementsException;
@@ -4189,6 +4190,9 @@ public class SystemHandler extends BaseHandler {
SystemRecord rec = SystemRecord.lookupById(
CobblerXMLRPCHelper.getConnection(loggedInUser), server.getCobblerId());
+ if (rec == null) {
+ throw new NoSuchCobblerSystemRecordException();
+ }
Map vars = new HashMap();
vars.put("netboot", rec.isNetbootEnabled());
@@ -4238,6 +4242,9 @@ public class SystemHandler extends BaseHandler {
SystemRecord rec = SystemRecord.lookupById(
CobblerXMLRPCHelper.getConnection(loggedInUser), server.getCobblerId());
+ if (rec == null) {
+ throw new NoSuchCobblerSystemRecordException();
+ }
rec.enableNetboot(netboot);
rec.setKsMeta(variables);
commit 0ee558e8c42b5c48a2388db9b6a3aca604b2065f
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Tue Feb 23 14:26:03 2010 +0100
make code more simple
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerVirtualSystemCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerVirtualSystemCommand.java
index d078f35..8fb6860 100644
--- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerVirtualSystemCommand.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerVirtualSystemCommand.java
@@ -109,14 +109,8 @@ public class CobblerVirtualSystemCommand extends CobblerSystemCreateCommand {
protected SystemRecord lookupExisting() {
log.debug("lookupExisting called.");
- SystemRecord rec = SystemRecord.lookupByName(
+ return SystemRecord.lookupByName(
CobblerXMLRPCHelper.getConnection(user), getCobblerSystemRecordName());
- if (rec == null) {
- return null;
- }
- else {
- return rec;
- }
}
13 years, 9 months
Changes to 'refs/tags/spacewalk-backend-0.9.5-1'
by Michael Mraka
Tag 'spacewalk-backend-0.9.5-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-02-23 15:22 +0000
Tagging package [spacewalk-backend] version [0.9.5-1] in directory [backend/].
Changes since yum-rhn-plugin-0.9.1-1:
Michael Mraka (7):
added heuristic to recognize whether url is mirrorlist or plain repo
made --mirrorlist obsolete
generate repolabel according to url
let yum be default type
if not --url, use channel repo url from database
fixed --label warning condition
Automatic commit of package [spacewalk-backend] release [0.9.5-1].
---
backend/satellite_tools/repo_plugins/yum_src.py | 30 +++++++++++---
backend/satellite_tools/reposync.py | 49 +++++++++++++++---------
backend/spacewalk-backend.spec | 5 +-
rel-eng/packages/spacewalk-backend | 2
4 files changed, 59 insertions(+), 27 deletions(-)
---
13 years, 9 months
backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/spacewalk-backend.spec | 5 ++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 24346feed3dc0d99c693ae6175ad6af76b7ca594
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Feb 23 16:22:48 2010 +0100
Automatic commit of package [spacewalk-backend] release [0.9.5-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 89ffc34..9939cf0 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 0.9.4
+Version: 0.9.5
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -621,6 +621,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Tue Feb 23 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.9.5-1
+- improved spacewalk-repo-sync
+
* Mon Feb 22 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.9.4-1
- fixed import error proxy ImportError: No module named server
- 246480 - sync last_modified column for rhnKickstartableTree as well.
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index a93ec7e..96fa5d3 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-0.9.4-1 backend/
+0.9.5-1 backend/
13 years, 9 months
6 commits - backend/satellite_tools
by Michael Mraka
backend/satellite_tools/repo_plugins/yum_src.py | 30 +++++++++++---
backend/satellite_tools/reposync.py | 49 +++++++++++++++---------
2 files changed, 54 insertions(+), 25 deletions(-)
New commits:
commit ce49456bf7481d91a113e9476f8925e28526ba0f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Feb 23 16:02:14 2010 +0100
fixed --label warning condition
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index bf72094..b11e0f6 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -14,6 +14,7 @@
# in this software or its documentation.
#
import sys, os, time, grp
+import hashlib
from optparse import OptionParser
from server import rhnPackage, rhnSQL, rhnChannel, rhnPackageUpload
from common import CFG, initCFG, rhnLog, fetchTraceback
@@ -77,7 +78,7 @@ class RepoSync:
if not options.channel_label:
quit = True
self.error_msg("--channel must be specified")
- if not options.label:
+ if options.label:
self.error_msg("--label is obsoleted")
if options.mirror:
self.error_msg("--mirrorlist is obsoleted; mirrorlist is recognized automatically")
commit 0b784eeee6d9bac077fa540ceb9de4c48b1cb4e0
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Feb 19 17:04:00 2010 +0100
if not --url, use channel repo url from database
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index 9f56155..bf72094 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -59,8 +59,21 @@ class RepoSync:
quit = False
if not options.url:
- quit = True
- self.error_msg("--url must be specified")
+ if options.channel_label:
+ h = rhnSQL.prepare("""select s.source_url
+ from rhnChannelContentSource s,
+ rhnChannel c
+ where c.id = s.channel_id
+ and c.label = :label""")
+ h.execute(label=options.channel_label)
+ source_urls = h.fetchall_dict() or []
+ if source_urls:
+ self.url = source_urls[0]['source_url']
+ else:
+ quit = True
+ self.error_msg("Channel has no URL associated")
+ else:
+ self.url = options.url
if not options.channel_label:
quit = True
self.error_msg("--channel must be specified")
@@ -77,7 +90,6 @@ class RepoSync:
sys.exit(1)
self.type = options.type
- self.url = options.url
self.channel_label = options.channel_label
self.fail = options.fail
self.repo_label = self.short_hash(self.url)
commit 20352bb092944acda965d156319d0d8e2c505ee4
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Feb 19 16:44:10 2010 +0100
let yum be default type
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index 7946697..9f56155 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -61,9 +61,6 @@ class RepoSync:
if not options.url:
quit = True
self.error_msg("--url must be specified")
- if not options.type:
- quit = True
- self.error_msg("--type must be specified")
if not options.channel_label:
quit = True
self.error_msg("--channel must be specified")
@@ -99,7 +96,7 @@ class RepoSync:
self.parser = OptionParser()
self.parser.add_option('-u', '--url', action='store', dest='url', help='The url to sync')
self.parser.add_option('-c', '--channel', action='store', dest='channel_label', help='The label of the channel to sync packages to')
- self.parser.add_option('-t', '--type', action='store', dest='type', help='The type of repo, currently only "yum" is supported')
+ self.parser.add_option('-t', '--type', action='store', dest='type', help='The type of repo, currently only "yum" is supported', default='yum')
self.parser.add_option('-l', '--label', action='store_true', dest='label', help='Ignored; for compatibility with old versions')
self.parser.add_option('-f', '--fail', action='store_true', dest='fail', default=False , help="If a package import fails, fail the entire operation")
self.parser.add_option('-q', '--quiet', action='store_true', dest='quiet', default=False, help="Print no output, still logs output")
commit 263e1e93e50b0bacd2d643517d39cad7aa285d3d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Feb 19 15:58:22 2010 +0100
generate repolabel according to url
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index 170ef15..7946697 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -26,6 +26,7 @@ from server.importlib.packageImport import ChannelPackageSubscription
default_log_location = '/var/log/rhn/reposync/'
+default_hash = 'sha256'
class RepoSync:
@@ -46,10 +47,10 @@ class RepoSync:
(options, args) = self.process_args()
log_filename = 'reposync.log'
- if options.channel_label and options.label:
+ if options.channel_label:
date = time.localtime()
datestr = '%d.%02d.%02d-%02d:%02d:%02d' % (date.tm_year, date.tm_mon, date.tm_mday, date.tm_hour, date.tm_min, date.tm_sec)
- log_filename = options.channel_label + '-' + options.label + '-' + datestr + '.log'
+ log_filename = options.channel_label + '-' + datestr + '.log'
rhnLog.initLOG(default_log_location + log_filename)
#os.fchown isn't in 2.4 :/
@@ -67,8 +68,7 @@ class RepoSync:
quit = True
self.error_msg("--channel must be specified")
if not options.label:
- quit = True
- self.error_msg("--label must be specified")
+ self.error_msg("--label is obsoleted")
if options.mirror:
self.error_msg("--mirrorlist is obsoleted; mirrorlist is recognized automatically")
@@ -83,7 +83,7 @@ class RepoSync:
self.url = options.url
self.channel_label = options.channel_label
self.fail = options.fail
- self.repo_label = options.label
+ self.repo_label = self.short_hash(self.url)
self.quiet = options.quiet
self.channel = self.load_channel()
@@ -100,7 +100,7 @@ class RepoSync:
self.parser.add_option('-u', '--url', action='store', dest='url', help='The url to sync')
self.parser.add_option('-c', '--channel', action='store', dest='channel_label', help='The label of the channel to sync packages to')
self.parser.add_option('-t', '--type', action='store', dest='type', help='The type of repo, currently only "yum" is supported')
- self.parser.add_option('-l', '--label', action='store', dest='label', help='A friendly label to refer to the repo')
+ self.parser.add_option('-l', '--label', action='store_true', dest='label', help='Ignored; for compatibility with old versions')
self.parser.add_option('-f', '--fail', action='store_true', dest='fail', default=False , help="If a package import fails, fail the entire operation")
self.parser.add_option('-q', '--quiet', action='store_true', dest='quiet', default=False, help="Print no output, still logs output")
self.parser.add_option('-m', '--mirrorlist', action='store_true', dest='mirror', default=False, help="Ignored; for compatibility with old versions. Mirrorlist is recognized automatically.")
@@ -218,6 +218,9 @@ class RepoSync:
def log_msg(self, message):
rhnLog.log_clean(0, message)
+ def short_hash(self, str):
+ return hashlib.new(default_hash, str).hexdigest()[0:8]
+
class ContentPackage:
def __init__(self):
commit ce953139d8004c2dad6560343e1471c5cfd850e1
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Feb 19 15:40:20 2010 +0100
made --mirrorlist obsolete
diff --git a/backend/satellite_tools/repo_plugins/yum_src.py b/backend/satellite_tools/repo_plugins/yum_src.py
index 1bcfe50..3e9db13 100644
--- a/backend/satellite_tools/repo_plugins/yum_src.py
+++ b/backend/satellite_tools/repo_plugins/yum_src.py
@@ -34,13 +34,11 @@ class ContentSource:
url = None
name = None
repo = None
- mirrorlist = False
cache_dir = '/var/cache/rhn/reposync/'
- def __init__(self, url, name, mirrorlist):
+ def __init__(self, url, name):
self.url = url
self.name = name
self._clean_cache(self.cache_dir + name)
- self.mirrorlist = mirrorlist
def list_packages(self):
""" list packages"""
diff --git a/backend/satellite_tools/reposync.py b/backend/satellite_tools/reposync.py
index e808bf5..170ef15 100644
--- a/backend/satellite_tools/reposync.py
+++ b/backend/satellite_tools/reposync.py
@@ -38,7 +38,6 @@ class RepoSync:
fail = False
repo_label = None
quiet = False
- mirrorlist = False
def main(self):
initCFG('server')
@@ -70,6 +69,8 @@ class RepoSync:
if not options.label:
quit = True
self.error_msg("--label must be specified")
+ if options.mirror:
+ self.error_msg("--mirrorlist is obsoleted; mirrorlist is recognized automatically")
self.log_msg("\nSync started: %s" % (time.asctime(time.localtime())))
self.log_msg(str(sys.argv))
@@ -83,7 +84,6 @@ class RepoSync:
self.channel_label = options.channel_label
self.fail = options.fail
self.repo_label = options.label
- self.mirrorlist = options.mirror
self.quiet = options.quiet
self.channel = self.load_channel()
@@ -91,7 +91,7 @@ class RepoSync:
print "Channel does not exist or is not custom"
sys.exit(1)
- self.plugin = self.load_plugin()(self.url, self.channel_label + "-" + self.repo_label, self.mirrorlist)
+ self.plugin = self.load_plugin()(self.url, self.channel_label + "-" + self.repo_label)
self.import_packages(self.plugin.list_packages())
self.print_msg("Sync complete")
@@ -103,7 +103,7 @@ class RepoSync:
self.parser.add_option('-l', '--label', action='store', dest='label', help='A friendly label to refer to the repo')
self.parser.add_option('-f', '--fail', action='store_true', dest='fail', default=False , help="If a package import fails, fail the entire operation")
self.parser.add_option('-q', '--quiet', action='store_true', dest='quiet', default=False, help="Print no output, still logs output")
- self.parser.add_option('-m', '--mirrorlist', action='store_true', dest='mirror', default=False, help="Treat --url as a mirror list (may not be supported by all content sources)")
+ self.parser.add_option('-m', '--mirrorlist', action='store_true', dest='mirror', default=False, help="Ignored; for compatibility with old versions. Mirrorlist is recognized automatically.")
return self.parser.parse_args()
def load_plugin(self):
commit 6bc72ee3923f7eab68376dc62c030901d4db8675
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Feb 19 15:14:23 2010 +0100
added heuristic to recognize whether url is mirrorlist or plain repo
diff --git a/backend/satellite_tools/repo_plugins/yum_src.py b/backend/satellite_tools/repo_plugins/yum_src.py
index 3af0637..1bcfe50 100644
--- a/backend/satellite_tools/repo_plugins/yum_src.py
+++ b/backend/satellite_tools/repo_plugins/yum_src.py
@@ -18,6 +18,18 @@ import shutil
from yum import config
from satellite_tools.reposync import ContentPackage
+class UrlIsNotMirror(Exception):
+ pass
+
+class SpacewalkYumRepository(yum.yumRepo.YumRepository):
+ def _readMirrorList(self, fo, url=None):
+ retval = yum.yumRepo.YumRepository._readMirrorList(self, fo, url)
+ # passed repo url as mirrorlist
+ if (len(retval[0]) == len(retval[1])
+ and retval[1][0][0:2] == '<!'):
+ raise UrlIsNotMirror
+ return retval
+
class ContentSource:
url = None
name = None
@@ -32,15 +44,21 @@ class ContentSource:
def list_packages(self):
""" list packages"""
- repo = yum.yumRepo.YumRepository(self.name)
+ repo = SpacewalkYumRepository(self.name)
self.repo = repo
repo.cache = 0
repo.metadata_expire = 0
- if self.mirrorlist:
+ repo.basecachedir = self.cache_dir
+
+ try: # try if url is mirrorlist
repo.mirrorlist = self.url
- else:
+ repo.baseurlSetup()
+ except UrlIsNotMirror, e:
+ # well, not a mirrorlist, just plain repo
+ repo.mirrorlist = None
repo.baseurl = [self.url]
- repo.basecachedir = self.cache_dir
+ repo.baseurlSetup()
+
repo.baseurlSetup()
repo.setup(False)
sack = repo.getPackageSack()
13 years, 9 months
Changes to 'refs/tags/yum-rhn-plugin-0.9.1-1'
by Miroslav Suchý
Tag 'yum-rhn-plugin-0.9.1-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-02-23 10:48 +0000
Tagging package [yum-rhn-plugin] version [0.9.1-1] in directory [client/rhel/yum-rhn-plugin/].
Changes since spacewalk-backend-0.9.4-1:
Justin Sherrill (1):
fixing docs for list snippet api calls
Miroslav Suchý (1):
Automatic commit of package [yum-rhn-plugin] release [0.9.1-1].
---
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 5 ++++-
java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/snippet/SnippetHandler.java | 3 ---
rel-eng/packages/yum-rhn-plugin | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
---
13 years, 9 months
client/rhel rel-eng/packages
by Miroslav Suchý
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec | 5 ++++-
rel-eng/packages/yum-rhn-plugin | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 898eb8af917fa106ba3ee6bee74c14ac4eb98cd5
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Feb 23 11:48:14 2010 +0100
Automatic commit of package [yum-rhn-plugin] release [0.9.1-1].
diff --git a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
index 2a19f20..33ad75d 100644
--- a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
+++ b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
@@ -1,6 +1,6 @@
Summary: RHN support for yum
Name: yum-rhn-plugin
-Version: 0.9.0
+Version: 0.9.1
Release: 1%{?dist}
License: GPLv2
Group: System Environment/Base
@@ -53,6 +53,9 @@ rm -rf $RPM_BUILD_ROOT
%doc LICENSE
%changelog
+* Tue Feb 23 2010 Miroslav Suchý <msuchy(a)redhat.com> 0.9.1-1
+- rebuild for rhel6
+
* Thu Feb 04 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.8.5-1
- updated copyrights
diff --git a/rel-eng/packages/yum-rhn-plugin b/rel-eng/packages/yum-rhn-plugin
index 154f24a..6eb542d 100644
--- a/rel-eng/packages/yum-rhn-plugin
+++ b/rel-eng/packages/yum-rhn-plugin
@@ -1 +1 @@
-0.8.5-1 client/rhel/yum-rhn-plugin/
+0.9.1-1 client/rhel/yum-rhn-plugin/
13 years, 9 months
java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/snippet/SnippetHandler.java | 3 ---
1 file changed, 3 deletions(-)
New commits:
commit 21ee1bf40342e0e9f5e0e194e6be1906ebf7d470
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Mon Feb 22 12:41:53 2010 -0500
fixing docs for list snippet api calls
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/snippet/SnippetHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/snippet/SnippetHandler.java
index 46fc0a5..06bc74b 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/snippet/SnippetHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/snippet/SnippetHandler.java
@@ -47,7 +47,6 @@ public class SnippetHandler extends BaseHandler {
*
* @xmlrpc.doc List all cobbler snippets for the logged in user
* @xmlrpc.param #param("string", "sessionKey")
- * @xmlrpc.param #param("int", "serverId")
* @xmlrpc.returntype
* #array()
* $SnippetSerializer
@@ -67,7 +66,6 @@ public class SnippetHandler extends BaseHandler {
* @xmlrpc.doc List only custom snippets for the logged in user.
* These snipppets are editable.
* @xmlrpc.param #param("string", "sessionKey")
- * @xmlrpc.param #param("int", "serverId")
* @xmlrpc.returntype
* #array()
* $SnippetSerializer
@@ -87,7 +85,6 @@ public class SnippetHandler extends BaseHandler {
* @xmlrpc.doc List only pre-made default snippets for the logged in user.
* These snipppets are not editable.
* @xmlrpc.param #param("string", "sessionKey")
- * @xmlrpc.param #param("int", "serverId")
* @xmlrpc.returntype
* #array()
* $SnippetSerializer
13 years, 9 months
Changes to 'refs/tags/spacewalk-backend-0.9.4-1'
by Michael Mraka
Tag 'spacewalk-backend-0.9.4-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-02-22 15:16 +0000
Tagging package [spacewalk-backend] version [0.9.4-1] in directory [backend/].
Changes since spacewalk-utils-0.9.4-1:
Michael Mraka (2):
fixed Makefiles according to apache.py move
Automatic commit of package [spacewalk-backend] release [0.9.4-1].
---
backend/common/Makefile | 1 +
backend/server/Makefile | 2 +-
backend/spacewalk-backend.spec | 4 ++--
rel-eng/packages/spacewalk-backend | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
---
13 years, 9 months