Re: [Spacewalk-devel] [PATCH] Filters on reposync
Baptiste AGASSE wrote: % Hi, % % I've just looked at reposync.py code a I don't see any part related to % getting include/exclude filters from database as properties of % repositories that Jan asked me when i've submited some code for % filters (he said that he didn't like that filters are specified at % runtime). % % Any news on it ? If, you decide to store filters in database, these % will be accessible through repositories webui ? Hi Baptiste, yesterday and today I finally saved some time to look into it again. I added a database table to hold include/exclude filters and spacewalk-repo-sync code which is able to use it. Unfortunately there's not webUI part yet so if you want to check it you have to insert filter data directy into database. E.g. insert into rhncontentsourcefilter (id, source_id, sort_order, flag, filter) values (sequence_nextval('rhn_csf_id_seq') , 536, 1, '+', 'samba-client'); where source_id is repository id (that's the end part as in https:///rhn/channels/manage/repos/RepoEdit.do?id=536 url), sort_order specifies the order of filters which belong to the same repo, flag is either '+' or '-' (include / exclude) and filter is the list of packages to be filtered. Regards. -- Michael Mráka Satellite Engineering, Red Hat ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] erratas and the client plugin package action
On 05/13/2011 02:27 PM, Miroslav Suchý wrote: On 05/13/2011 02:22 PM, Duncan Mac-Vicar P. wrote: Would it make more sense for errata.py to be in the yum-rhn-plugin? It fine with me. yum-rhn-plugin and rhn-client-tools require each other (on rhel/fedora) anyway. So yes, it can be moved to yum-rhn-plugin. For *SUSE I think we will have to override errata.py as zypper should install the patch directly and not let the plugin resolve the package list. Would it be acceptable upstream that we don't install errata.py from the .spec file %if 0%{?suse_version} and supply it with zypp-plugin-spacewalk (which contains package.py)? That possible as well. I slightly prefer the first option (move it to yum-rhn-plugin). But choose yourself. Can we still move errata.py to yum-rhn-plugin? We've gone with the second option until now, but this would make packaging cleaner. -Ionuț >From 8bfecb11e2f14b1f922bb2986693840e8dc77107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20Ar=C8=9B=C4=83ri=C8=99i?= Date: Tue, 18 Oct 2011 16:49:24 +0200 Subject: [PATCH] move errata.py action to the yum-rhn-plugin package --- client/rhel/rhn-client-tools/rhn-client-tools.spec |1 - client/rhel/rhn-client-tools/src/actions/Makefile |2 +- client/rhel/rhn-client-tools/src/actions/errata.py | 87 client/rhel/yum-rhn-plugin/actions/errata.py | 87 4 files changed, 88 insertions(+), 89 deletions(-) delete mode 100644 client/rhel/rhn-client-tools/src/actions/errata.py create mode 100644 client/rhel/yum-rhn-plugin/actions/errata.py diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec index 8d9f58b..51292fb 100644 --- a/client/rhel/rhn-client-tools/rhn-client-tools.spec +++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec @@ -249,7 +249,6 @@ make -f Makefile.rhn-client-tools test # actions for rhn_check to run %{_datadir}/rhn/actions/__init__.* %{_datadir}/rhn/actions/hardware.* -%{_datadir}/rhn/actions/errata.* %{_datadir}/rhn/actions/systemid.* %{_datadir}/rhn/actions/reboot.* %{_datadir}/rhn/actions/rhnsd.* diff --git a/client/rhel/rhn-client-tools/src/actions/Makefile b/client/rhel/rhn-client-tools/src/actions/Makefile index 2d72848..fec4eff 100644 --- a/client/rhel/rhn-client-tools/src/actions/Makefile +++ b/client/rhel/rhn-client-tools/src/actions/Makefile @@ -3,7 +3,7 @@ # $Id$ ACTIONS = up2date_config hardware reboot \ - rhnsd systemid errata __init__ + rhnsd systemid __init__ PYFILES = $(addsuffix .py, $(ACTIONS)) OBJECTS = $(PYFILES) $(addsuffix .pyc, $(ACTIONS)) diff --git a/client/rhel/rhn-client-tools/src/actions/errata.py b/client/rhel/rhn-client-tools/src/actions/errata.py deleted file mode 100644 index 49f1c65..000 --- a/client/rhel/rhn-client-tools/src/actions/errata.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/python - -# Client code for Update Agent -# Copyright (c) 1999-2002 Red Hat, Inc. Distributed under GPL. -# -# Author: Adrian Likins 4: -# Newer sats send down arch, filter using name+arch -for p in packagelist: - if current_packages_with_arch.has_key(p[0]+p[4]): - u[p[0]+p[4]] = p - elif current_packages_with_arch.has_key(p[0]+"noarch"): - u[p[0]+p[4]] = p - elif p[4] == "noarch" and current_packages.has_key(p[0]): - u[p[0]] = p -else: -# 5.2 and older sats + hosted dont send arch -for p in packagelist: -if current_packages.has_key(p[0]): -u[p[0]] = p - - -# XXX: Fix me - once we keep all errata packages around, -# this is the WRONG thing to do - we want to keep the specific versions -# that the user has asked for. -packagelist = map(lambda a: u[a], u.keys()) - -if packagelist == []: - data = {} - data['version'] = "0" - data['name'] = "errata.update.no_packages" - data['erratas'] = errataidlist - - return (39, - "No packages from that errata are available", - data) - -return packages.update(packagelist, cache_only) - - -def main(): - print update([23423423]) - - -if __name__ == "__main__": - main() - diff --git a/client/rhel/yum-rhn-plugin/actions/errata.py b/client/rhel/yum-rhn-plugin/actions/errata.py new file mode 100644 index 000..49f1c65 --- /dev/null +++ b/client/rhel/yum-rhn-plugin/actions/errata.py @@ -0,0 +1,87 @@ +#!/usr/bin/python + +# Client code for Update Agent +# Copyright (c) 1999-2002 Red Hat, Inc. Distributed under GPL. +# +# Author: Adrian Likins 4: +# Newer sats send down arch, filter using name+arch +for p in packagelist: + if current_packages_with_arch.has_key(p[0]+p[4]): + u[p[0]+p[4]] = p + elif current_packages_with_arch.has_key(p[0]+"noarch"): + u[p[0]+p[4]] = p + elif p[4] == "noarch" and current_packages.has_key(p[0]): + u[p[0]] = p +else: +# 5.2 and older sats + hosted dont send arch +for p in packagelist:
[Spacewalk-devel] [Proposal] Schema change of rhnServerInterface due IPv6
I recently changed rhnServerNetwork due IPv6 and it was quite straight. Now I focused on rhnServerInterface and I want to give you chance to argue with me, before I do the change. :) Today the table looks like: http://spacewalk.redhat.com/documentation/schema-doc/table-RHNSERVERNETINTERFACE.html It has columns: * SERVER_ID NUMBER(38) * NAME VARCHAR2(32) IP_ADDR VARCHAR2(64) NETMASK VARCHAR2(64) BROADCAST VARCHAR2(64) HW_ADDR VARCHAR2(18) MODULE VARCHAR2(128) CREATED DATE MODIFIEDDATE "*" marks primary key Previusly clients send over XMLRPC this data: intDict[interface] = {'hwaddr':hwaddr, 'ipaddr':ipaddr, 'netmask':netmask, 'broadcast':broadcast, 'module': module } for some time (since 2010-11-20) it send: intDict[interface] = {'hwaddr':hwaddr, 'ipaddr':ipaddr, 'netmask':netmask, 'broadcast':broadcast, 'module': module, 'ipv6': ip6_list} where ip6_list is: ip6_list.append({ 'scope': ip6.scope, 'addr':ip6.address, 'netmask': ip6.netmask }) The ipv6 key/value pair is ignored by server for now. The IPv6 stuff will not fit into current table so I come with following solution: Simplify table rhnServerInterface to columns: * SERVER_ID NUMBER(38) * NAME VARCHAR2(32) HW_ADDR VARCHAR2(18) MODULE VARCHAR2(128) CREATED DATE MODIFIEDDATE Create new table rhnServerInterfaceIPv4 with columns: * SERVER_ID NUMBER(38) * NAME VARCHAR2(32) IP_ADDR VARCHAR2(64) NETMASK VARCHAR2(64) BROADCAST VARCHAR2(64) CREATED DATE MODIFIEDDATE Migration of existing data from rhnServerInterface to this new table is easy and should not be problem. Create new table rhnServerInterfaceIPv6 with columns: * SERVER_ID NUMBER(38) * NAME VARCHAR2(32) SCOPE VARCHAR2(19) ADDRVARCHAR2(45) NETMASK VARCHAR2(49) CREATED DATE MODIFIEDDATE SCOPE can be (according rfc2373): scop is a 4-bit multicast scope value used to limit the scope of the multicast group. The values are: 0 reserved 1 node-local scope 2 link-local scope 3 (unassigned) 4 (unassigned) 5 site-local scope 6 (unassigned) 7 (unassigned) 8 organization-local scope 9 (unassigned) A (unassigned) B (unassigned) C (unassigned) longest is organization-local with 19 chars, but I seen more different strings already ("local", "universe" etc.). So I tend to think that more general VARCHAR(128) would be better here. ADDR - longest IPv6 address can be 45 character wide. While we may normalize the address and make it shorter. Question is whether we want it normalize here or exactly as we get it over wire. NETMASK - it is addr plus "/128" as longest prefix. Comments? -- Miroslav Suchy Red Hat Satellite Engineering ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] erratas and the client plugin package action
On 10/18/2011 04:53 PM, Ionuț Arțăriși wrote: > Can we still move errata.py to yum-rhn-plugin? We've gone with the > second option until now, but this would make packaging cleaner. Still no objections. -- Miroslav Suchy Red Hat Satellite Engineering ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] erratas and the client plugin package action
On 10/18/2011 05:17 PM, Miroslav Suchý wrote: On 10/18/2011 04:53 PM, Ionuț Arțăriși wrote: Can we still move errata.py to yum-rhn-plugin? We've gone with the second option until now, but this would make packaging cleaner. Still no objections. Cool. So can you apply the patch that I attached to my previous email? Thanks, -Ionuț ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel
Re: [Spacewalk-devel] erratas and the client plugin package action
Dne 18.10.2011 17:56, Ionuț Arțăriși napsal(a): Cool. So can you apply the patch that I attached to my previous email? Ahh, I did not notice it first time - sorry. Applied. Thanks. Mirek ___ Spacewalk-devel mailing list Spacewalk-devel@redhat.com https://www.redhat.com/mailman/listinfo/spacewalk-devel