Re: [Spacewalk-devel] Spacewalk on RHEL8 - Step 3 completed - YUM replacement

2020-05-06 Thread Michael Calmer
Hi

Am Mittwoch, 6. Mai 2020, 10:25:06 CEST schrieb Stefan Bluhm:
> Hello all,

[...] 
 
> Open topics:
> - Move the server to Python 3 and remove Python 2 scripts.

Uyuni made the move to python3 over a year ago ... and we still find places 
which break.
I would strongly suggest you check the uyuni git repo and try to find the 
commits. It will save you month of work.

-- 
Regards
  
    Michael Calmer

------
Michael Calmer
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer (HRB 36809, AG 
Nürnberg)




___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel



Re: [Spacewalk-devel] Action chaining - table names

2014-01-23 Thread Michael Calmer
Hi,

Am Donnerstag, 23. Januar 2014, 11:55:49 schrieb Michael Mraka:
 Hi Silvio,
 
 I've come across commit 8844fcb10460d7d9838e89e376e09e7b1539b3fe
 which adds new tables for action chaining feature.
 I noticed all table/trigger/constraint names have 'suse' prefix.
 I guess I understand why you named it that way :).

I am not sure that you know the real reason :-)

 Anyway
 majority of tables have rhn prefix but it isn't because they were
 created by Red Hat engineers rather then just a legacy prefix from old days
 when Satellite was born as Red Hat Network (and many years later opensourced
 as Spacewalk project).
 
 So we continue to use rhn prefix even if the project is called
 differently nowadays because renaming of all tables is just not worth of it.

Exactly. And this is also the reason why we use suse prefix/namespace.
Sometimes we have a feature ready and released in our product before we try to 
upstream it. And what we want to prevent is a potential conflict in the table 
names.

Additionally it happens in the past, that some of our feature did not make it 
upstream (reject, no response anymore or requested to much changes we were 
unable to do). What would now happen, if somebody else start a new feature and 
choose the same table name we already use in our product? 

= A nightmare :-) So we use the suse prefix and such things cannot happen.

 To sum it up - I'd like new tables to continue with old rhn prefix naming.

In case of ActionChaining and other features I think it is doable, if we know 
that it will be merged upstream. If this is still unclear or we get a reject, 
we need to keep the suse prefix.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)


___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] broken CVE URL in updateinfo.xml generated by spacewalk

2014-01-21 Thread Michael Calmer
Hi,

just found a bug which cause CVE references in updateinfo.xml.gz files look 
like this:


reference 
href=http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=com.redhat.rhn.domain.errata.Cve@3e28377d;
 id=CVE-1999- type=cve/

The attached patch should fix this.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 0613fb443f2c9a0cf16606cbde2328420d21 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Tue, 21 Jan 2014 11:29:24 +0100
Subject: [PATCH] fix CVE URL in updateinfo references

---
 .../src/com/redhat/rhn/taskomatic/task/repomd/UpdateInfoWriter.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/UpdateInfoWriter.java b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/UpdateInfoWriter.java
index fcd465b..9654085 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/UpdateInfoWriter.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/UpdateInfoWriter.java
@@ -241,11 +241,12 @@ public class UpdateInfoWriter extends RepomdWriter {
 iter = erratum.getCves().iterator();
 while (iter.hasNext()) {
 Cve cve = (Cve) iter.next();
+String cveid = sanitize(0L, cve.getName());
 
 SimpleAttributesImpl attr = new SimpleAttributesImpl();
 attr.addAttribute(href,
-http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=; + cve);
-attr.addAttribute(id, sanitize(0L, cve.getName()));
+http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=; + cveid);
+attr.addAttribute(id, cveid);
 attr.addAttribute(type, cve);
 handler.startElement(reference, attr);
 handler.endElement(reference);
-- 
1.8.1.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCHES] CVE-ID changing syntax in 2014

2014-01-15 Thread Michael Calmer
Hi,

I think you already heard from the fact, that mitre.org change the syntax of 
CVE IDs with the beginning of 2014.

 https://cve.mitre.org/cve/identifiers/syntaxchange.html

Currently there are 4 digits at the end which can be in future more.

In spacewalk DB, the name column in rhnCVE is limited to 13 characters which 
is not enough in the future.

I have attached 3 patches which increase the size to 20 which will hopefully 
enough for a long time.

I hope I catched all places where the old format is expected.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 4e83d44ba79b8073ee994810c64ab6a7e4a0c850 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Wed, 15 Jan 2014 10:32:33 +0100
Subject: [PATCH 1/3] increase length of rhnCVE name column

---
 schema/spacewalk/common/tables/rhnCVE.sql | 2 +-
 .../040-inc-length-rhnCVE-name.sql.oracle | 1 +
 .../040-inc-length-rhnCVE-name.sql.postgresql | 4 
 3 files changed, 6 insertions(+), 1 deletion(-)
 create mode 100644 schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/040-inc-length-rhnCVE-name.sql.oracle
 create mode 100644 schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/040-inc-length-rhnCVE-name.sql.postgresql

diff --git a/schema/spacewalk/common/tables/rhnCVE.sql b/schema/spacewalk/common/tables/rhnCVE.sql
index 1056841..8a87c30 100644
--- a/schema/spacewalk/common/tables/rhnCVE.sql
+++ b/schema/spacewalk/common/tables/rhnCVE.sql
@@ -19,7 +19,7 @@ CREATE TABLE rhnCVE
 idNUMBER NOT NULL
   CONSTRAINT rhn_cve_id_pk PRIMARY KEY
   USING INDEX TABLESPACE [[2m_tbs]],
-name  VARCHAR2(13) NOT NULL
+name  VARCHAR2(20) NOT NULL
 )
 ENABLE ROW MOVEMENT
 ;
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/040-inc-length-rhnCVE-name.sql.oracle b/schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/040-inc-length-rhnCVE-name.sql.oracle
new file mode 100644
index 000..4a69f93
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/040-inc-length-rhnCVE-name.sql.oracle
@@ -0,0 +1 @@
+alter table rhnCVE MODIFY (name varchar2(20));
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/040-inc-length-rhnCVE-name.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/040-inc-length-rhnCVE-name.sql.postgresql
new file mode 100644
index 000..4d95439
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-2.0-to-spacewalk-schema-2.1/040-inc-length-rhnCVE-name.sql.postgresql
@@ -0,0 +1,4 @@
+-- oracle equivalent source sha1 46195ba34d7b16f69ba16ff2d982b8a7fb0e5e39
+
+ALTER TABLE rhnCVE
+ALTER COLUMN name TYPE varchar(20);
-- 
1.8.1.4

From 6f13c41f3aca1d31a7178af32437c14bc05adaa3 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Wed, 15 Jan 2014 11:01:59 +0100
Subject: [PATCH 2/3] backend: increase length of rhnCVE name column

---
 backend/server/importlib/backendOracle.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/server/importlib/backendOracle.py b/backend/server/importlib/backendOracle.py
index 604192c..4c118f3 100644
--- a/backend/server/importlib/backendOracle.py
+++ b/backend/server/importlib/backendOracle.py
@@ -242,7 +242,7 @@ class OracleBackend(Backend):
 Table('rhnCVE',
 fields  = {
 'id': DBint(),
-'name'  : DBstring(13),
+'name'  : DBstring(20),
 },
 pk  = ['name'],
 ),
-- 
1.8.1.4

From 743be982055741afc54349a9754f9f97fe10d903 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Wed, 15 Jan 2014 12:00:04 +0100
Subject: [PATCH 3/3] java: increase column length for CVE ids

---
 java/code/src/com/redhat/rhn/domain/errata/Cve.hbm.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/code/src/com/redhat/rhn/domain/errata/Cve.hbm.xml b/java/code/src/com/redhat/rhn/domain/errata/Cve.hbm.xml
index 7b3c630..04837f8 100644
--- a/java/code/src/com/redhat/rhn/domain/errata/Cve.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/errata/Cve.hbm.xml
@@ -11,7 +11,7 @@ PUBLIC -//Hibernate/Hibernate Mapping DTD 3.0//EN
 param name=sequencerhn_cve_id_seq/param
 /generator
 /id
-property name=name column=name type=string length=13 /
+property name=name column=name type=string length=20

Re: [Spacewalk-devel] RFC: manage bare-metal systems from Spacewalk

2013-12-18 Thread Michael Calmer
Hi,

Am Mittwoch, 18. Dezember 2013, 14:22:49 schrieb Michael Mraka:
 Silvio Moioli wrote:
 % Dear Spacewalk Team,
 %
[...] 
 Hi Silvio,
 
 how does registration from this bootstrap image differs from the
 situation when I create standard kickstart with minimal set of packages
 to register the system to my org and boot the system from this kickstart?

Not too much.

* we use now also rhnreg_ks with a special activation key which give you a
  bootstrap entitlementen and no base channel is assigned.
* bootstrap entitlements are free (2 per org)
  this is not so important for spacewalk, but for SUSE Manager and Satellite
  where you have to pay for management entitlements
* directly after registration it does a shutdown
* nothing is installed on the harddisk, the image exists only in RAM
  - this give you the possibility to see the host in spacewalk and assign
the final kickstart profile to this host. If you turn this host on again
it boots again via PXE and install the correct profile.
If you use a re-registration key, the history will stay.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)


___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] replace UTF-8 space with normal space

2013-11-20 Thread Michael Calmer
Hi,

when we build spacewalk-java we got ugly warnings like this one:

[   84s] [javac] /usr/src/packages/BUILD/spacewalk-java-
git-5625.44000ca/build/jsp-
temp/org/apache/jsp/WEB_002dINF/pages/admin/errata/confirm_jsp.java:498: 
warning: unmappable character for encoding ASCII
[   84s] [javac] 
_jspx_th_rhn_005ftoolbar_005f2.setIcon(spacewalk-icon-enhancement);

Seems, that we introduced a UTF-8 space there.

The attached patch replace them with a normal space character.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 0ec921f199b133fd47e8efa1e90e691ae6977bdb Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Wed, 20 Nov 2013 16:08:36 +0100
Subject: [PATCH] replace UTF-8 space character with normal space character

---
 java/code/webapp/WEB-INF/pages/admin/errata/cloneconfirm.jsp  | 2 +-
 java/code/webapp/WEB-INF/pages/channel/erratalist.jsp | 2 +-
 java/code/webapp/WEB-INF/pages/channel/manage/addcustomerrata.jsp | 2 +-
 java/code/webapp/WEB-INF/pages/channel/manage/adderrataredhat.jsp | 2 +-
 java/code/webapp/WEB-INF/pages/channel/manage/confirmerrata.jsp   | 2 +-
 java/code/webapp/WEB-INF/pages/channel/manage/erratasync.jsp  | 2 +-
 .../webapp/WEB-INF/pages/common/fragments/errata/errata-header.jspf   | 2 +-
 .../webapp/WEB-INF/pages/common/fragments/errata/erratadelete.jspf| 2 +-
 .../WEB-INF/pages/common/fragments/errata/ownedlistdisplay.jspf   | 2 +-
 .../WEB-INF/pages/common/fragments/errata/relevant-errata-list.jspf   | 2 +-
 .../WEB-INF/pages/common/fragments/yourrhn/mostCriticalSystems.jsp| 2 +-
 java/code/webapp/WEB-INF/pages/errata/erratasearch.jsp| 4 ++--
 java/code/webapp/WEB-INF/pages/ssm/packageupgrade.jsp | 2 +-
 java/code/webapp/WEB-INF/pages/ssm/systems/ssm-errata.jsp | 2 +-
 .../code/webapp/WEB-INF/pages/systems/details/packages/upgradable.jsp | 2 +-
 java/code/webapp/WEB-INF/pages/systems/errata.jsp | 2 +-
 java/code/webapp/WEB-INF/pages/systems/errataconfirm.jsp  | 2 +-
 17 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/java/code/webapp/WEB-INF/pages/admin/errata/cloneconfirm.jsp b/java/code/webapp/WEB-INF/pages/admin/errata/cloneconfirm.jsp
index a186edb..3c2052a 100644
--- a/java/code/webapp/WEB-INF/pages/admin/errata/cloneconfirm.jsp
+++ b/java/code/webapp/WEB-INF/pages/admin/errata/cloneconfirm.jsp
@@ -23,7 +23,7 @@
 i class=fa fa-bug/i
 /c:if
 c:if test=${current.productEnhancement}
-i class=fa  spacewalk-icon-enhancement/i
+i class=fa  spacewalk-icon-enhancement/i
 /c:if
 /rhn:column
 rhn:column header=erratalist.jsp.advisory
diff --git a/java/code/webapp/WEB-INF/pages/channel/erratalist.jsp b/java/code/webapp/WEB-INF/pages/channel/erratalist.jsp
index f6291af..ea2846d 100644
--- a/java/code/webapp/WEB-INF/pages/channel/erratalist.jsp
+++ b/java/code/webapp/WEB-INF/pages/channel/erratalist.jsp
@@ -35,7 +35,7 @@
 	i class=fa fa-bug title=bean:message key='erratalist.jsp.bugadvisory' //i
 	/c:if
 	c:if test=${current.productEnhancement}
-	i class=fa  spacewalk-icon-enhancement title=bean:message key='erratalist.jsp.productenhancementadvisory' //i
+	i class=fa  spacewalk-icon-enhancement title=bean:message key='erratalist.jsp.productenhancementadvisory' //i
 	/c:if
 
 /rl:column
diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/addcustomerrata.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/addcustomerrata.jsp
index 9d25e72..c94b317 100644
--- a/java/code/webapp/WEB-INF/pages/channel/manage/addcustomerrata.jsp
+++ b/java/code/webapp/WEB-INF/pages/channel/manage/addcustomerrata.jsp
@@ -100,7 +100,7 @@
 			i class=fa fa-bug title=bean:message key='erratalist.jsp.bugadvisory'//i
 			/c:if
 			c:if test=${current.productEnhancement}
-			i class=fa  spacewalk-icon-enhancement title=bean:message key='erratalist.jsp.productenhancementadvisory'//i
+			i class=fa  spacewalk-icon-enhancement title=bean:message key='erratalist.jsp.productenhancementadvisory'//i
 			/c:if
 /rl:column	  		
 		  		
diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/adderrataredhat.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/adderrataredhat.jsp
index 3a36eb3..17b88a8 100644
--- a/java/code/webapp/WEB-INF/pages/channel/manage/adderrataredhat.jsp
+++ b/java/code

Re: [Spacewalk-devel] [PATCH] Add support for enhances weak dependency

2013-10-22 Thread Michael Calmer
Hi,

Am Dienstag, 22. Oktober 2013, 14:51:42 schrieb Michael Mraka:
 Michael Calmer wrote:
 % Hi,
 %
 % just found out that we forgot one rpm weak dependency.
 % Enhances is a waek version of Supplements and is heavyly used at SUSE.
 %
 % 4 patches add the support for it to
 %
 % 001: spacewalk-backend
 % 002: java (taskomatic)
 % 003: web
 % 004: schema
 %
 % Patch 005 remove all cached metadata and trigger a regeneration for all
 % channels.
 % Feel free to skip this patch if you think that this is not needed.
 
 Hello Michael,
 
 I've reviewed your changes and commited patches. There was a small issue
 in table alias which I've fixed in e8650f095af2d37e106fdde4d14cb2d78540112b.

Ah. (Always the same problems with copy and paste:-)
Thank you. 

Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)


___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] Add support for enhances weak dependency

2013-10-21 Thread Michael Calmer
Hi,

just found out that we forgot one rpm weak dependency.
Enhances is a waek version of Supplements and is heavyly used at SUSE.

4 patches add the support for it to 

001: spacewalk-backend
002: java (taskomatic)
003: web
004: schema

Patch 005 remove all cached metadata and trigger a regeneration for all 
channels.
Feel free to skip this patch if you think that this is not needed.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 6e249cd0e501de5f6efb00c4efb4680ad16f19ec Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 18 Oct 2013 13:47:55 +0200
Subject: [PATCH 1/5] add support for enhances rpm weak dependencies (backend)
 (bnc#846436)

---
 backend/satellite_tools/exporter/exportLib.py|  2 ++
 backend/satellite_tools/spacewalk-remove-channel |  1 +
 backend/satellite_tools/xmlSource.py |  5 +
 backend/server/importlib/backend.py  |  1 +
 backend/server/importlib/backendOracle.py| 10 ++
 backend/server/importlib/headerSource.py | 16 +---
 backend/server/importlib/importLib.py|  1 +
 backend/server/importlib/mpmSource.py|  1 +
 backend/server/importlib/packageImport.py|  6 +++---
 backend/server/repomd/domain.py  |  1 +
 backend/server/repomd/mapper.py  | 14 ++
 backend/server/repomd/view.py|  4 
 backend/server/rhnChannel.py | 17 -
 13 files changed, 72 insertions(+), 7 deletions(-)

diff --git a/backend/satellite_tools/exporter/exportLib.py b/backend/satellite_tools/exporter/exportLib.py
index 5e14af2..aeb1c08 100644
--- a/backend/satellite_tools/exporter/exportLib.py
+++ b/backend/satellite_tools/exporter/exportLib.py
@@ -839,6 +839,8 @@ class _PackageDumper(BaseRowDumper):
 'rhn-package-suggests-entry'],
 ['rhnPackageSupplements',  'rhn-package-supplements',
 'rhn-package-supplements-entry'],
+['rhnPackageEnhances',  'rhn-package-enhances',
+'rhn-package-enhances-entry'],
]
 for table_name, container_name, entry_name in mappings:
 h = rhnSQL.prepare(
diff --git a/backend/satellite_tools/spacewalk-remove-channel b/backend/satellite_tools/spacewalk-remove-channel
index 53fd3d9..f3b5d2e 100755
--- a/backend/satellite_tools/spacewalk-remove-channel
+++ b/backend/satellite_tools/spacewalk-remove-channel
@@ -488,6 +488,7 @@ def _delete_rpm_group(packageIds):
 'rhnPackageRecommends',
 'rhnPackageSuggests',
 'rhnPackageSupplements',
+'rhnPackageEnhances',
 'rhnServerNeededCache',
 ]
 deleteStatement = delete from %s where package_id = :package_id
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index 81fd3a5..6ce2c3d 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -603,6 +603,7 @@ class PackageItem(IncompletePackageItem):
 'rhn-package-recommends': 'recommends',
 'rhn-package-suggests'  : 'suggests',
 'rhn-package-supplements'   : 'supplements',
+'rhn-package-enhances'  : 'enhances',
 'rhn-package-changelog' : 'changelog',
 }
 tagMap.update(IncompletePackageItem.tagMap)
@@ -686,6 +687,10 @@ class SupplementsItem(DependencyItem):
 item_name = 'rhn-package-supplements-entry'
 addItem(SupplementsItem)
 
+class EnhancesItem(DependencyItem):
+item_name = 'rhn-package-enhances-entry'
+addItem(EnhancesItem)
+
 class FileItem(BaseChecksummedItem):
 item_name = 'rhn-package-file'
 item_class = importLib.File
diff --git a/backend/server/importlib/backend.py b/backend/server/importlib/backend.py
index f907794..797079b 100644
--- a/backend/server/importlib/backend.py
+++ b/backend/server/importlib/backend.py
@@ -732,6 +732,7 @@ class Backend:
 'rhnPackageRecommends': 'package_id',
 'rhnPackageSuggests':   'package_id',
 'rhnPackageSupplements':'package_id',
+'rhnPackageEnhances'   :'package_id',
 'rhnPackageFile':   'package_id',
 'rhnPackageChangeLogRec':  'package_id',
 }
diff --git a/backend/server/importlib/backendOracle.py b/backend/server/importlib/backendOracle.py
index acca10f..604192c 100644
--- a/backend/server/importlib/backendOracle.py
+++ b/backend/server/importlib/backendOracle.py
@@ -100,6 +100,16 @@ class OracleBackend(Backend):
 attribute   = 'supplements',
 map

[Spacewalk-devel] [PATCH] Fix field length of erratum-advisory-name

2013-09-13 Thread Michael Calmer
Hi,

in ISS export the field length in erratum-advisory-name is too short.
The DB can store 100, while the code expect only 32. This will strip errata 
names to 32 chars and produce possible dupplicate key errors while it could 
store 100 chars without a problem.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From f4076ff1499a4bc955728be518ae473d80fff327 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 12 Sep 2013 17:04:19 +0200
Subject: [PATCH] Fix field length of erratum-advisory-name to match real DB
 field length

---
 backend/satellite_tools/exporter/exportLib.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/satellite_tools/exporter/exportLib.py b/backend/satellite_tools/exporter/exportLib.py
index 6386625..5e14af2 100644
--- a/backend/satellite_tools/exporter/exportLib.py
+++ b/backend/satellite_tools/exporter/exportLib.py
@@ -1036,7 +1036,7 @@ class _ErratumDumper(BaseRowDumper):
 arr = []
 
 mappings = [
-('rhn-erratum-advisory-name', 'advisory_name', 32),
+('rhn-erratum-advisory-name', 'advisory_name', 100),
 ('rhn-erratum-advisory-rel', 'advisory_rel', 32),
 ('rhn-erratum-advisory-type', 'advisory_type', 32),
 ('rhn-erratum-product', 'product', 64),
-- 
1.8.1.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] fix metadata - generate pre flag into primary.xml

2013-07-05 Thread Michael Calmer
Hi,

we found a bug in how spacewalk generate the repomd metadata.
PreRequires are not flagged in primary.xml.

The attached patch fixes this problem.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 5908262665c2db84246ddf6d3739d58ce5c4f6a4 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 5 Jul 2013 13:52:34 +0200
Subject: [PATCH] Generate pre flag into the metadata

---
 .../redhat/rhn/taskomatic/task/repomd/PrimaryXmlWriter.java   | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/PrimaryXmlWriter.java b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/PrimaryXmlWriter.java
index 512520b..5df0d87 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/PrimaryXmlWriter.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/PrimaryXmlWriter.java
@@ -303,6 +303,10 @@ public class PrimaryXmlWriter extends RepomdWriter {
 attr.addAttribute(rel, evrMap.get(release));
 }
 
+if (hasPreFlag(pkgCapIter.getNumber(sense).longValue())) {
+attr.addAttribute(pre, 1);
+}
+
 localHandler.startElement(rpm:entry, attr);
 localHandler.endElement(rpm:entry);
 }
@@ -403,4 +407,11 @@ public class PrimaryXmlWriter extends RepomdWriter {
 }
 }
 
+/**
+ * @param senseIn package sense
+ * @return true in case the pre flag is set, otherwise false
+ */
+private boolean hasPreFlag(long senseIn) {
+return ((senseIn  (1  6))  0) ? true : false;
+}
 }
-- 
1.8.1.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] fix metadata - generate pre flag into primary.xml

2013-07-05 Thread Michael Calmer
Hi,

sorry, the patch has a bug. Here is a new one.

Am Freitag, 5. Juli 2013, 14:33:18 schrieb Michael Calmer:
 Hi,
 
 we found a bug in how spacewalk generate the repomd metadata.
 PreRequires are not flagged in primary.xml.
 
 The attached patch fixes this problem.
-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From f4c6227bd191fe6dcaed36b60cbd1060d6286e9d Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 5 Jul 2013 13:52:34 +0200
Subject: [PATCH] Generate pre flag into the metadata

---
 .../redhat/rhn/taskomatic/task/repomd/PrimaryXmlWriter.java   | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/PrimaryXmlWriter.java b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/PrimaryXmlWriter.java
index 512520b..20f7f73 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/PrimaryXmlWriter.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/PrimaryXmlWriter.java
@@ -303,6 +303,10 @@ public class PrimaryXmlWriter extends RepomdWriter {
 attr.addAttribute(rel, evrMap.get(release));
 }
 
+if (hasPreFlag(capability.getSense())) {
+attr.addAttribute(pre, 1);
+}
+
 localHandler.startElement(rpm:entry, attr);
 localHandler.endElement(rpm:entry);
 }
@@ -403,4 +407,11 @@ public class PrimaryXmlWriter extends RepomdWriter {
 }
 }
 
+/**
+ * @param senseIn package sense
+ * @return true in case the pre flag is set, otherwise false
+ */
+private boolean hasPreFlag(long senseIn) {
+return ((senseIn  (1  6))  0) ? true : false;
+}
 }
-- 
1.8.1.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] Proxy: do not read the body of a request into memory

2013-04-26 Thread Michael Calmer
Hi,

we had here some trouble with the proxy and installing hughe RPMs. In the end 
we found the OOM killer working because the proxy load the complete RPM into 
memory during delivery.

So I created two patches for the proxy:

0001: Is when sending content to the server via the proxy. Typically this way 
not much data are transfered, but it can happen. So I removed the body 
parameter from several functions and use self.req instead.

0002: This is when receiving data from the Server and deliver it to the 
client. I used the SmartIO class to create a temp file when copying the data 
from the response into the request. A direct usage of the FD was not possible. 
It seems, that the response FD is already removed when the request function 
try to read from it. So we need a temp file.
Note: SmartIO uses /tmp by default to create the tempfile. New systems 
sometimes uses tmpfs on /tmp (Fedora?). So it might be a good idea to change 
the default to a place without tmpfs.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 264b8a81d7d37b487de5849a048e8ad7869fd58c Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 18 Apr 2013 12:38:50 +0200
Subject: [PATCH 1/2] do not read data into memory which should be send to the
 server

---
 proxy/proxy/broker/rhnBroker.py |  3 +--
 proxy/proxy/redirect/rhnRedirect.py |  4 ++--
 proxy/proxy/rhnShared.py| 19 ---
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/proxy/proxy/broker/rhnBroker.py b/proxy/proxy/broker/rhnBroker.py
index 00f920e..ddd2e34 100644
--- a/proxy/proxy/broker/rhnBroker.py
+++ b/proxy/proxy/broker/rhnBroker.py
@@ -201,7 +201,6 @@ class BrokerHandler(SharedHandler):
   % repr(_oto['X-RHN-Proxy-Auth']))
 
 log_debug(3, 'Trying to connect to parent')
-data = self.req.read()
 
 # Loops twice? Here's why:
 #   o If no errors, the loop is broken and we move on.
@@ -214,7 +213,7 @@ class BrokerHandler(SharedHandler):
 # Add the proxy version
 rhnFlags.get('outputTransportOptions')['X-RHN-Proxy-Version'] = str(_PROXY_VERSION)
 
-status = self._serverCommo(data)   # part 2
+status = self._serverCommo()   # part 2
 
 # check for proxy authentication blowup.
 respHeaders = self.responseContext.getHeaders()
diff --git a/proxy/proxy/redirect/rhnRedirect.py b/proxy/proxy/redirect/rhnRedirect.py
index 7f73fd8..e633132 100644
--- a/proxy/proxy/redirect/rhnRedirect.py
+++ b/proxy/proxy/redirect/rhnRedirect.py
@@ -90,7 +90,7 @@ class RedirectHandler(SharedHandler):
 self._connectToParent()  # part 1
 
 log_debug(4, 'Initiating communication with server...')
-status = self._serverCommo(self.req.read())   # part 2
+status = self._serverCommo()   # part 2
 if (status != apache.OK) and (status != apache.HTTP_PARTIAL_CONTENT):
 log_debug(3, Leaving handler with status code %s % status)
 return status
@@ -413,7 +413,7 @@ class RedirectHandler(SharedHandler):
 # redirected, so we can safely pass an empty string in as the request
 # body.
 
-status = self._serverCommo('')
+status = self._serverCommo()
 
 # This little hack isn't pretty, but lets us normalize our result code.
 
diff --git a/proxy/proxy/rhnShared.py b/proxy/proxy/rhnShared.py
index c44fad8..ba6df9d 100644
--- a/proxy/proxy/rhnShared.py
+++ b/proxy/proxy/rhnShared.py
@@ -181,11 +181,10 @@ class SharedHandler:
 port = None
 return scheme, host, port, path
 
-def _serverCommo(self, data):
+def _serverCommo(self):
  Handler part 2
 
 Server (or next proxy) communication.
-data is the self.req.read()
 
 
 log_debug(1)
@@ -199,7 +198,7 @@ class SharedHandler:
 
 # Send the headers, the body and expect a response
 try:
-status, headers, bodyFd = self._proxy2server(data)
+status, headers, bodyFd = self._proxy2server()
 self.responseContext.setHeaders(headers)
 self.responseContext.setBodyFd(bodyFd)
 except IOError:
@@ -325,13 +324,19 @@ class SharedHandler:
 
 self._forwardHTTPBody(bodyFd, self.req)
 
-def _proxy2server(self, body):
+def _proxy2server(self):
 hdrs = rhnFlags.get('outputTransportOptions')
-log_debug(3, hdrs, Content length, len(body))
+log_debug(3, hdrs)
+size = -1
 
 # Put the headers

[Spacewalk-devel] [PATCH] timeout configuration for satsync

2013-04-22 Thread Michael Calmer
Hi,

I saw some work to make the connection timeout configurable for the proxy and 
yum-plugin-spacewalk.
Also the server uses the rpclib. I saw similar problems using satellite-sync, 
so I created a patch which introduce a timeout variable in rhn_server.conf

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 9e8cfaaf8e98e5254b2f475fd3d126bc5b7173e8 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 22 Apr 2013 16:58:03 +0200
Subject: [PATCH] make rpclib connection timeout configurable

---
 backend/rhn-conf/rhn_server.conf  |  3 +++
 backend/satellite_tools/connection.py | 11 +++
 backend/satellite_tools/rhn_satellite_activate.py |  3 ++-
 backend/satellite_tools/xmlWireSource.py  |  4 ++--
 backend/spacewalk-backend.spec|  6 +++---
 5 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/backend/rhn-conf/rhn_server.conf b/backend/rhn-conf/rhn_server.conf
index c3ce9c1..4f9e313 100644
--- a/backend/rhn-conf/rhn_server.conf
+++ b/backend/rhn-conf/rhn_server.conf
@@ -26,6 +26,9 @@ client_auth_timeout = 3600.0
 # 6 hours
 proxy_auth_timeout = 21600.0
 
+# rpclib connection timeout
+timeout = 120
+
 # Directory location of cached packages lists. (Created automatically)
 pkg_list_dir = /var/up2date/list
 
diff --git a/backend/satellite_tools/connection.py b/backend/satellite_tools/connection.py
index 394874a..45a8c50 100644
--- a/backend/satellite_tools/connection.py
+++ b/backend/satellite_tools/connection.py
@@ -87,9 +87,10 @@ class _Server(rpclib.Server):
 
 class StreamConnection(_Server):
 def __init__(self, uri, proxy=None, username=None, password=None, 
-refreshCallback=None, xml_dump_version=constants.PROTOCOL_VERSION):
+refreshCallback=None, xml_dump_version=constants.PROTOCOL_VERSION,
+timeout=None):
 _Server.__init__(self, uri, proxy=proxy, username=username,
-password=password, refreshCallback=refreshCallback)
+password=password, refreshCallback=refreshCallback, timeout=timeout)
 self.add_header(X-RHN-Satellite-XML-Dump-Version, xml_dump_version)
 
 class GETServer(rpclib.GETServer):
@@ -100,7 +101,8 @@ class GETServer(rpclib.GETServer):
 _transport_class_https_proxy = SafeProxyTransport
 def __init__(self, uri, transport=None, proxy=None, username=None,
 password=None, client_version=2, headers={}, refreshCallback=None,
-progressCallback=None, xml_dump_version=constants.PROTOCOL_VERSION):
+progressCallback=None, xml_dump_version=constants.PROTOCOL_VERSION,
+timeout=None):
 rpclib.GETServer.__init__(self, uri,
 transport=transport,
 proxy=proxy,
@@ -108,7 +110,8 @@ class GETServer(rpclib.GETServer):
 password=password,
 client_version=client_version,
 headers=headers,
-refreshCallback=refreshCallback)
+refreshCallback=refreshCallback,
+timeout=timeout)
 self.add_header(X-RHN-Satellite-XML-Dump-Version, xml_dump_version)
 
 class CompressedStream:
diff --git a/backend/satellite_tools/rhn_satellite_activate.py b/backend/satellite_tools/rhn_satellite_activate.py
index 73f57c0..c753dcc 100644
--- a/backend/satellite_tools/rhn_satellite_activate.py
+++ b/backend/satellite_tools/rhn_satellite_activate.py
@@ -89,7 +89,8 @@ def getXmlrpcServer(server, handler, proxy, proxyUser, proxyPass,
 uri = 'http://' + _uri
 
 s = rpclib.Server(uri, refreshCallback=None,
- proxy=proxy, username=proxyUser, password=proxyPass)
+ proxy=proxy, username=proxyUser, password=proxyPass,
+ timeout=CFG.timeout)
 if sslYN and sslCertPath:
 if not os.access(sslCertPath, os.R_OK):
 sys.stderr.write(SSL CA Cert inaccessible: '%s'\n % sslCertPath)
diff --git a/backend/satellite_tools/xmlWireSource.py b/backend/satellite_tools/xmlWireSource.py
index c46b357..8e95f71 100644
--- a/backend/satellite_tools/xmlWireSource.py
+++ b/backend/satellite_tools/xmlWireSource.py
@@ -106,7 +106,7 @@ class BaseWireSource:
 
 serverObj = connection.StreamConnection(url, proxy=CFG.HTTP_PROXY, 
 username=CFG.HTTP_PROXY_USERNAME, password=CFG.HTTP_PROXY_PASSWORD,
-xml_dump_version=self.xml_dump_version)
+xml_dump_version=self.xml_dump_version, timeout=CFG.timeout)
 BaseWireSource.serverObj = serverObj
 return serverObj
 
@@ -363,7 +363,7

Re: [Spacewalk-devel] [PATCH] Kickstartable channels should contain the anaconda package

2013-03-22 Thread Michael Calmer
Hi,

please do not apply these patches. I found out, that it is not correct.
It removes the channels at more places than needed.

Am Mittwoch, 13. März 2013, 17:33:50 schrieb Johannes Renner:
 Hey,
 
 attached is a patch that should take care that only kickstartable channels
 are actually returned by the getKickstartableChannels() method in the
 ChannelFactory class.
 
 In addition to the existing query, it is checked if the 'anaconda' package
 is included in all of the returned channels. If that's not the right
 package to check for or not the way to go in general, then we can fix it of
 course.
 
 Regards,
 Johannes
-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)


___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] some bugfixes

2013-03-22 Thread Michael Calmer
Hi,

here is a set of 5 patches. One enhancement and 4 fixes:

0001:
add openSUSE-12.3 to spacewalk-common-channels-config

0002:
do not read rpm into memory before transferring to client

0003:
do not call not existing function

0004:
catch libvirtError to return meaningfull error messages

0005:
isInstallerConfig should check for autoyast in commandline


-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 12daf0a61d1cc6b6e806896102fd94b6f78083d6 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Wed, 13 Mar 2013 16:06:11 +0100
Subject: [PATCH 1/5] add openSUSE 12.3 to spacewalk-common-channels config

---
 utils/spacewalk-common-channels.ini | 52 +
 1 file changed, 52 insertions(+)

diff --git a/utils/spacewalk-common-channels.ini b/utils/spacewalk-common-channels.ini
index cc5dbac..5a38984 100644
--- a/utils/spacewalk-common-channels.ini
+++ b/utils/spacewalk-common-channels.ini
@@ -723,6 +723,14 @@ checksum = sha1
 base_channels = opensuse12_2-%(arch)s
 yumrepo_url = http://download.opensuse.org/update/12.2/
 
+[opensuse12_2-non-oss-updates]
+label= %(base_channel)s-non-oss-updates
+name = openSUSE 12.2 non oss Updates (%(arch)s)
+archs= i586, x86_64
+checksum = sha1
+base_channels = opensuse12_2-%(arch)s
+yumrepo_url = http://download.opensuse.org/update/12.2-non-oss/
+
 [spacewalk18-client-opensuse12_2]
 name = Spacewalk Client 1.8 %(base_channel_name)s
 archs= i586, x86_64
@@ -732,3 +740,47 @@ gpgkey_url = http://download.opensuse.org/repositories/systemsmanagement:/spacew
 gpgkey_id = A0E46E11
 gpgkey_fingerprint = 68D3 3874 9967 0AEB D988  2DB3 2ABF A143 A0E4 6E11
 yumrepo_url = http://download.opensuse.org/repositories/systemsmanagement:/spacewalk:/1.8/openSUSE_12.2/
+
+[opensuse12_3]
+checksum = sha256
+archs= i586, x86_64
+name = openSUSE 12.3 (%(arch)s)
+gpgkey_url = http://download.opensuse.org/distribution/12.3/repo/oss/suse/repodata/repomd.xml.key
+gpgkey_id = 3DBDC284
+gpgkey_fingerprint = 22C0 7BA5 3417 8CD0 2EFE  22AA B88B 2FD4 3DBD C284
+yumrepo_url = http://download.opensuse.org/distribution/12.3/repo/oss/suse/
+dist_map_release = 12.3
+
+[opensuse12_3-non-oss]
+label= %(base_channel)s-non-oss
+name = openSUSE 12.3 non oss (%(arch)s)
+archs= i586, x86_64
+checksum = sha256
+base_channels = opensuse12_3-%(arch)s
+yumrepo_url = http://download.opensuse.org/distribution/12.3/repo/non-oss/suse/
+
+[opensuse12_3-updates]
+label= %(base_channel)s-updates
+name = openSUSE 12.3 Updates (%(arch)s)
+archs= i586, x86_64
+checksum = sha256
+base_channels = opensuse12_3-%(arch)s
+yumrepo_url = http://download.opensuse.org/update/12.3/
+
+[opensuse12_3-non-oss-updates]
+label= %(base_channel)s-non-oss-updates
+name = openSUSE 12.3 non oss Updates (%(arch)s)
+archs= i586, x86_64
+checksum = sha256
+base_channels = opensuse12_3-%(arch)s
+yumrepo_url = http://download.opensuse.org/update/12.3-non-oss/
+
+[spacewalk19-client-opensuse12_3]
+name = Spacewalk Client 1.9 %(base_channel_name)s
+archs= i586, x86_64
+base_channels = opensuse12_3-%(arch)s
+checksum = sha256
+gpgkey_url = http://download.opensuse.org/repositories/systemsmanagement:/spacewalk:/1.9/openSUSE_12.3/repodata/repomd.xml.key
+gpgkey_id = A0E46E11
+gpgkey_fingerprint = 68D3 3874 9967 0AEB D988  2DB3 2ABF A143 A0E4 6E11
+yumrepo_url = http://download.opensuse.org/repositories/systemsmanagement:/spacewalk:/1.9/openSUSE_12.3/
-- 
1.8.2

From 6c9d20e0c76e22a50de4ffc24d544da676d54479 Mon Sep 17 00:00:00 2001
From: Hubert Mantel man...@suse.de
Date: Thu, 14 Mar 2013 16:39:43 +0100
Subject: [PATCH 2/5] do not read rpm into memory before transferring to client
 (bnc#801151)

---
 backend/server/apacheRequest.py | 50 -
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/backend/server/apacheRequest.py b/backend/server/apacheRequest.py
index cd61870..a30f714 100644
--- a/backend/server/apacheRequest.py
+++ b/backend/server/apacheRequest.py
@@ -264,27 +264,35 @@ class apacheRequest:
 
 # send the headers
 self.req.send_http_header()
-# and the file
-read = 0
-while read  response_size:
-# We check the size here in case we're not asked for the entire file.
-if (read + CFG.BUFFER_SIZE  response_size):
-to_read = read + CFG.BUFFER_SIZE - response_size
-else:
-to_read = CFG.BUFFER_SIZE
-buf = response.read(CFG.BUFFER_SIZE)
-if not buf:
-break

Re: [Spacewalk-devel] [PATCH] update uptime quickly after reboot

2012-12-07 Thread Michael Calmer
Hi,

Am Freitag, 7. Dezember 2012, 09:37:04 schrieb Jan Pazdziora:
 On Fri, Oct 19, 2012 at 01:25:31PM +0200, Michael Calmer wrote:
  Hi,
  
  with the new reboot needed feature introduced some month ago, we realized
  a
  small issue.
  
  If a patch or package was installed which requires a reboot, the system
  got
  the yellow banner on the systems details page.
  
  If now a reboot is executed and you look at the page again shortly after
  the host is up, the banner is still there.
  
  The reason is, that the uptime value is updated with first invocation of
  rhn_check which happen in the default config of rhnsd between 2 and 6
  hours
  after rhnsd is started or in case of osad running when the first action is
  scheduled.
 
 Michael,
 
 I'm sorry I only now got to your post. I have a question here -- I
 assume the banner is there simply because the system needs reboot
 condition is based on the rhnServer.last_boot value, being compared to
 the package installation time. And until the server tells Spacewalk
 it has rebooted, Spacewalk assumes it has not.

right
 
 However, cannot the criteria for system needing reboot be amended
 by also looking at the system's actions, checking if there is
 a reboot.reboot action which was picked up after the package
 installation date / package installation action pickup? That way
 the feature would be purely server-based and work well even with old
 production clients, and the client parts would be an enhancement of
 the logic, not a mandatory part of the setup.

The feature is designed in a way, that also locally triggerd installations are 
catched using yum or zypper on the commandline. In such a case, the logged-in 
user might also trigger a reboot by himself without using the reboot action 
from spacewalk. Looking only for the reboot.rebbot action would then lead into 
showing this banner forever.

Additionally these patches solve another issue a lot of our customers have. 
They want immediately see in the webui when the last reboot was (after the 
system is up again). Waiting ~4 hours until the UI reflect the reality is not 
an option for them. Osad does not help in this case, because currently these 
data are only submitted, if rhn_check is running. You need to trigger an 
action to make osad calling rhn_check.

An enhancement could be, that in case a reboot.reboot action exists, the 
message change and say, that a reboot action is already triggered.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)


___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] [PATCH] update uptime quickly after reboot

2012-11-11 Thread Michael Calmer
Hi,

Am Freitag, 19. Oktober 2012, 13:25:31 schrieb Michael Calmer:
 Hi,

[...] 
 
 I developed a set of patches (attached) to fix this issue:
 
 1) add a new XMLRPC function queue.update_status(), which only get the
 status report of a system and update the database. It uses the same
 funcations as get() is using.
 2) add a new tool rhn-update-status to rhn-client-tools which send the
 status 3) change the init scripts of rhnsd to call rhn-update-status during
 start.

I have updated the patches and added the call of rhn-update-status also to the 
service file for systemd.

Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)From 890305befa72239eaeadc1e9923de50bed36f7ea Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Sun, 11 Nov 2012 15:42:37 +0100
Subject: [PATCH 5/5] call rhn-update-status if systemd is used

---
 client/rhel/rhnsd/rhnsd.service | 1 +
 1 file changed, 1 insertion(+)

diff --git a/client/rhel/rhnsd/rhnsd.service b/client/rhel/rhnsd/rhnsd.service
index 14b3e3b..b5e0f79 100644
--- a/client/rhel/rhnsd/rhnsd.service
+++ b/client/rhel/rhnsd/rhnsd.service
@@ -6,6 +6,7 @@ After=syslog.target network.target auditd.service
 PIDFile=/var/run/rhnsd.pid
 ExecStart=/usr/sbin/rhnsd
 ExecReload=/bin/kill -HUP $MAINPID
+ExecStartPost=/bin/bash -c [ -x /usr/sbin/rhn-update-status ]  /usr/sbin/rhn-update-status
 
 [Install]
 WantedBy=multi-user.target
-- 
1.7.12.4

From cc58d24ec68dd868ea23836d97aae6aef630a529 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 18 Oct 2012 17:40:47 +0200
Subject: [PATCH 1/5] add xmlrpc function update_status and server capability

---
 backend/server/handlers/xmlrpc/queue.py | 12 
 backend/server/rhnCapability.py |  1 +
 2 files changed, 13 insertions(+)

diff --git a/backend/server/handlers/xmlrpc/queue.py b/backend/server/handlers/xmlrpc/queue.py
index 4240d92..9fdc6d4 100644
--- a/backend/server/handlers/xmlrpc/queue.py
+++ b/backend/server/handlers/xmlrpc/queue.py
@@ -44,6 +44,7 @@ class Queue(rhnHandler):
 self.functions.append('get_future_actions')
 self.functions.append('length')
 self.functions.append('submit')
+self.functions.append('update_status')
 
 # XXX I am not proud of this. There should be a generic way to map
 # the client's error codes into success status codes
@@ -473,6 +474,17 @@ class Queue(rhnHandler):
 rhnSQL.commit()
 return 0
 
+def update_status(self, system_id, status = {}):
+# Authenticate the system certificate
+self.auth_system(system_id)
+log_debug(1, self.server_id, status)
+if status:
+self.__update_status(status)
+# commit all changes
+rhnSQL.commit()
+
+return 0
+
 def status_for_action_type_code(self, action_type, rcode):
  Convert whatever the client sends as a result code into a status in the
 database format
diff --git a/backend/server/rhnCapability.py b/backend/server/rhnCapability.py
index 9f2a82f..014f6a5 100644
--- a/backend/server/rhnCapability.py
+++ b/backend/server/rhnCapability.py
@@ -167,6 +167,7 @@ def _set_server_capabilities():
 'staging_content'   : {'version' : 1, 'value' : 1},
 'ipv6'  : {'version' : 1, 'value' : 1},
 'abrt.handle'   : {'version' : 1, 'value' : 1},
+'queue.update_status'   : {'version' : 1, 'value' : 1},
 }
 l = []
 for name, hashval in capabilities.items():
-- 
1.7.12.4

From f671be8e3505c264efe2ddd35702fc07df910334 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 18 Oct 2012 17:42:08 +0200
Subject: [PATCH 2/5] new script rhn-update-status to update the uptime and
 kernelver on the server

---
 client/rhel/rhn-client-tools/rhn-client-tools.spec |  1 +
 client/rhel/rhn-client-tools/src/bin/Makefile  | 13 +++---
 .../rhn-client-tools/src/bin/rhn-update-status.py  | 51 ++
 3 files changed, 59 insertions(+), 6 deletions(-)
 create mode 100755 client/rhel/rhn-client-tools/src/bin/rhn-update-status.py

diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index e009287..1da82a0 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -246,6 +246,7 @@ make -f Makefile.rhn-client-tools test
 %{_mandir}/man8/rhn_check.8*
 
 %{_sbindir}/rhn_check
+%{_sbindir}/rhn-update-status
 
 %{_datadir}/rhn/up2date_client/getMethod

Re: [Spacewalk-devel] [Patch] patches for openSUSE clients

2012-11-11 Thread Michael Calmer
Hi,

Am Mittwoch, 31. Oktober 2012, 10:17:27 schrieb Michael Calmer:
 Hi,
 
 attached you can find various patches to fix bugs in client tools for
 openSUSE

I have commited them to master now.

I added some more patches to master. One introduce rhnmd.service file for 
systemd. It is currently configured only for SUSE. I am not familar with fedora 
systemd configuration, but feel free to adapt the spec to use it also on 
fedora,

Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [Patch] patches for openSUSE clients

2012-10-31 Thread Michael Calmer
Hi,

attached you can find various patches to fix bugs in client tools for openSUSE

* 0001-BuildRequire-docbook-style-xsl-only-on-redhat.patch
docbook-style-xsl does not exist in openSUSE

* 0002 - 0005 no-use-of-var-lock-subsys-anymore
The directory does not exist anymore on openSUSE and it is not needed when 
using checkproc

* 0006-package-solaris-converter.patch
also openSUSE should include this files

* 0007-no-hal-for-openSUSE-11.4.patch
openSUSE  11.4 do not have hal anymore. Use gudev like fedora.

* 0008-check-if-etc-sysconfig-network-is-a-file.patch
On openSUSE distribution we do not have a file named /etc/sysconfig/network.
Check if it is a file and use the other methods to find the hostname if not.

* 0009-check-if-system-id-has-changed.patch
check if system id has changed. Helps with --force registration in short 
frequences.

* 0010-do-not-start-rhnsd-in-runlevel-2-which-has-no-networ.patch
runlevel 2 has no network, but it is required. So do not start rhnsd in 
runlevel 2.

Would be good, if they could be included in spacewalk 1.8

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 0f2dc898aeace073e20162b4cfb656ca3ad5523d Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Sun, 22 Apr 2012 16:33:37 +0200
Subject: [PATCH 01/10] BuildRequire docbook-style-xsl only on redhat

---
 spacewalk/pylint/spacewalk-pylint.spec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/spacewalk/pylint/spacewalk-pylint.spec b/spacewalk/pylint/spacewalk-pylint.spec
index 1d19687..76e9427 100644
--- a/spacewalk/pylint/spacewalk-pylint.spec
+++ b/spacewalk/pylint/spacewalk-pylint.spec
@@ -13,7 +13,7 @@ BuildArch:	noarch
 Requires:	pylint
 BuildRequires:	asciidoc
 BuildRequires:	libxslt
-%if 0%{?rhel}  6
+%if 0%{?rhel}  0%{?rhel}  6
 BuildRequires:	docbook-style-xsl
 %endif
 
-- 
1.7.12.4

From 575b0fc9bfcebea606601b05ee6ce4875c91ed28 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Sat, 6 Oct 2012 17:29:59 +0200
Subject: [PATCH 06/10] package solaris converter

---
 client/tools/rhnpush/rhnpush.spec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec
index 1db72d8..df79a1a 100644
--- a/client/tools/rhnpush/rhnpush.spec
+++ b/client/tools/rhnpush/rhnpush.spec
@@ -69,7 +69,7 @@ spacewalk-pylint $RPM_BUILD_ROOT%{rhnroot}
 %attr(755,root,root) %{_bindir}/rpm2mpm
 %config(noreplace) %attr(644,root,root) %{_sysconfdir}/sysconfig/rhn/rhnpushrc
 %{_mandir}/man8/rhnpush.8*
-%if 0%{?fedora} || 0%{?rhel}  5
+%if 0%{?fedora} || 0%{?rhel}  5 || 0%{?suse_version}
 %attr(755,root,root) %{_bindir}/solaris2mpm
 %{_mandir}/man8/solaris2mpm.8*
 %endif
-- 
1.7.12.4

From 7aedce61a7b65ee6e8c8cf550376dca0af96819b Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Sat, 20 Oct 2012 15:45:05 +0200
Subject: [PATCH 07/10] no hal for openSUSE = 11.4

---
 client/rhel/rhn-client-tools/rhn-client-tools.spec | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 75e32f4..9172738 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -23,7 +23,7 @@ Requires: dbus-1-python
 %else
 Requires: dbus-python
 %endif
-%if 0%{?fedora} || 0%{?rhel}  5
+%if 0%{?fedora} || 0%{?rhel}  5 || 0%{?suse_version} = 1140
 Requires: python-gudev
 Requires: python-hwdata
 %else
@@ -143,7 +143,7 @@ mkdir -p $RPM_BUILD_ROOT/var/lib/up2date
 mkdir -pm700 $RPM_BUILD_ROOT%{_localstatedir}/spool/up2date
 touch $RPM_BUILD_ROOT%{_localstatedir}/spool/up2date/loginAuth.pkl
 
-%if 0%{?fedora} || 0%{?rhel}  5
+%if 0%{?fedora} || 0%{?rhel}  5 || 0%{?suse_version} = 1140
 rm $RPM_BUILD_ROOT%{_datadir}/rhn/up2date_client/hardware_hal.*
 %else
 rm $RPM_BUILD_ROOT%{_datadir}/rhn/up2date_client/hardware_gudev.*
-- 
1.7.12.4

From ea5e8fe104fbd7fcda135b8d936cce7f73dd9fb9 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Sat, 5 May 2012 15:10:09 +0200
Subject: [PATCH 02/10] no use of /var/lock/subsys/ anymore

---
 client/rhel/rhnsd/rhnsd.init.SUSE | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/client/rhel/rhnsd/rhnsd.init.SUSE b/client/rhel/rhnsd/rhnsd.init.SUSE
index e2faf8e..d02a5af 100644
--- a/client/rhel/rhnsd/rhnsd.init.SUSE
+++ b/client/rhel/rhnsd/rhnsd.init.SUSE
@@ -66,8 +66,6 @@ rc_reset
 start() {
 echo -n $Starting Red Hat Network Daemon: 
 startproc -p $RHNSD_PIDFILE $RHNSD
-rc_status

Re: [Spacewalk-devel] [PATCH] Inconsistency in xmlrpc ChannelSerializer

2012-10-26 Thread Michael Calmer
Hi,

Am Mittwoch, 24. Oktober 2012, 12:57:47 schrieb Michael Mraka:
 Michael Calmer wrote:
 % Hi,

[...]

 % I see two possible fixes:
 %
 % 1) return new Date(0) instead of an empty string (01/01/1970)
 %
 % 2) break the API and declare yumrepo_last_sync as optional and do not
 return %this key in case the repo was not synced yet.
 %
 % Which fix would you prefer? Are there other possible fixes?
 
 Hi Michael,
 
 the second option is the preferred one.

Ok, patch is attached.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 7841f0d35cb904d56c375c54b98a5b07ed31198d Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 26 Oct 2012 11:18:24 +0200
Subject: [PATCH] Make yumrepo_last_sync optional. Do not return it, if the
 repo was never synced.

---
 .../redhat/rhn/frontend/xmlrpc/serializer/ChannelSerializer.java | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ChannelSerializer.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ChannelSerializer.java
index d4fdcaf..e11e1d1 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ChannelSerializer.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ChannelSerializer.java
@@ -53,7 +53,7 @@ import com.redhat.rhn.frontend.xmlrpc.serializer.util.SerializerHelper;
  *  #prop(string, gpg_key_url)
  *  #prop(string, gpg_key_id)
  *  #prop(string, gpg_key_fp)
- *  #prop(dateTime.iso8601, yumrepo_last_sync)
+ *  #prop_desc(dateTime.iso8601, yumrepo_last_sync, (optional))
  *  #prop(string, end_of_life)
  *  #prop(string, parent_channel_label)
  *  #prop(string, clone_original)
@@ -118,12 +118,7 @@ public class ChannelSerializer implements XmlRpcCustomSerializer {
 ContentSource cs = (ContentSource) itr.next();
 csList.add(cs);
 }
-if (c.getLastSynced() != null) {
-helper.add(yumrepo_last_sync, c.getLastSynced());
-}
-else {
-helper.add(yumrepo_last_sync, );
-}
+helper.add(yumrepo_last_sync, c.getLastSynced());
 }
 helper.add(contentSources, csList);
 
-- 
1.7.12.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] Inconsistency in xmlrpc ChannelSerializer

2012-10-25 Thread Michael Calmer
Hi,

Am Mittwoch, 24. Oktober 2012, 13:18:24 schrieb Jan Pazdziora:
 On Wed, Oct 24, 2012 at 12:57:47PM +0200, Michael Mraka wrote:
  Michael Calmer wrote:
  % Hi,
  %
  % a user found an inconsistency in the ChannelSerializer.
  %
  % Calling channel.software.associateRepo() return a channel struct
  % which contains the key yumrepo_last_sync. It is documented as
  % dateTime.iso8601 . But the result for a never synced channel is an
  empty % string.
  %
  % The reason can be found in
  % java/.../rhn/frontend/xmlrpc/serializer/ChannelSerializer.java Line 125
  %
  % In case getLastSynced() returns null, an empty string is added via the
  helper % and not a Date object.
  %
  % I see two possible fixes:
  %
  % 1) return new Date(0) instead of an empty string (01/01/1970)
  %
  % 2) break the API and declare yumrepo_last_sync as optional and do not
  return %this key in case the repo was not synced yet.
  %
  % Which fix would you prefer? Are there other possible fixes?
  
  Hi Michael,
  
  the second option is the preferred one.
 
 How hard would it be to move to (say) Apache XML-RPC which supports
 nil?

Hmm, is nil part of the standard or very typical? I think we should take 
care also of the client side. If there are a lot of client libs not supporting 
nil, we should not do such a change.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)


___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] update uptime quickly after reboot

2012-10-19 Thread Michael Calmer
Hi,

with the new reboot needed feature introduced some month ago, we realized a 
small issue. 

If a patch or package was installed which requires a reboot, the system got 
the yellow banner on the systems details page. 

If now a reboot is executed and you look at the page again shortly after the 
host is up, the banner is still there.

The reason is, that the uptime value is updated with first invocation of 
rhn_check which happen in the default config of rhnsd between 2 and 6 hours 
after rhnsd is started or in case of osad running when the first action is 
scheduled.

We cannot simply change rhnsd to do the first check immediately after start.
In case actions are scheduled, they will be executed during the boot process 
and nobody knows if everything is up and running.

I developed a set of patches (attached) to fix this issue:

1) add a new XMLRPC function queue.update_status(), which only get the status
   report of a system and update the database. It uses the same funcations as
   get() is using.
2) add a new tool rhn-update-status to rhn-client-tools which send the status
3) change the init scripts of rhnsd to call rhn-update-status during start.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 1c3b6b6a16d59305e44125467c7dc43ca152b289 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 18 Oct 2012 17:40:47 +0200
Subject: [PATCH 1/4] add xmlrpc function update_status and server capability

---
 backend/server/handlers/xmlrpc/queue.py |   12 
 backend/server/rhnCapability.py |1 +
 2 Dateien geändert, 13 Zeilen hinzugefügt(+)

diff --git a/backend/server/handlers/xmlrpc/queue.py b/backend/server/handlers/xmlrpc/queue.py
index 4240d92..9fdc6d4 100644
--- a/backend/server/handlers/xmlrpc/queue.py
+++ b/backend/server/handlers/xmlrpc/queue.py
@@ -44,6 +44,7 @@ class Queue(rhnHandler):
 self.functions.append('get_future_actions')
 self.functions.append('length')
 self.functions.append('submit')
+self.functions.append('update_status')
 
 # XXX I am not proud of this. There should be a generic way to map
 # the client's error codes into success status codes
@@ -473,6 +474,17 @@ class Queue(rhnHandler):
 rhnSQL.commit()
 return 0
 
+def update_status(self, system_id, status = {}):
+# Authenticate the system certificate
+self.auth_system(system_id)
+log_debug(1, self.server_id, status)
+if status:
+self.__update_status(status)
+# commit all changes
+rhnSQL.commit()
+
+return 0
+
 def status_for_action_type_code(self, action_type, rcode):
  Convert whatever the client sends as a result code into a status in the
 database format
diff --git a/backend/server/rhnCapability.py b/backend/server/rhnCapability.py
index 9f2a82f..014f6a5 100644
--- a/backend/server/rhnCapability.py
+++ b/backend/server/rhnCapability.py
@@ -167,6 +167,7 @@ def _set_server_capabilities():
 'staging_content'   : {'version' : 1, 'value' : 1},
 'ipv6'  : {'version' : 1, 'value' : 1},
 'abrt.handle'   : {'version' : 1, 'value' : 1},
+'queue.update_status'   : {'version' : 1, 'value' : 1},
 }
 l = []
 for name, hashval in capabilities.items():
-- 
1.7.10.4

From 2dbb54f64666efcb6f0b6676d200d874c1cbe40e Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 18 Oct 2012 17:42:08 +0200
Subject: [PATCH 2/4] new script rhn-update-status to update the uptime and
 kernelver on the server

---
 client/rhel/rhn-client-tools/rhn-client-tools.spec |1 +
 client/rhel/rhn-client-tools/src/bin/Makefile  |   13 ++---
 .../rhn-client-tools/src/bin/rhn-update-status.py  |   51 
 3 Dateien geändert, 59 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-)
 create mode 100755 client/rhel/rhn-client-tools/src/bin/rhn-update-status.py

diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 180b6e1..06a6ede 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -246,6 +246,7 @@ make -f Makefile.rhn-client-tools test
 %{_mandir}/man8/rhn_check.8*
 
 %{_sbindir}/rhn_check
+%{_sbindir}/rhn-update-status
 
 %{_datadir}/rhn/up2date_client/getMethod.*
 
diff --git a/client/rhel/rhn-client-tools/src/bin/Makefile b/client/rhel/rhn-client-tools/src/bin/Makefile
index 7a1e73e

Re: [Spacewalk-devel] [PATCH] Query not elaborated?

2012-08-07 Thread Michael Calmer
Hi,

Am Montag, 6. August 2012, 17:59:12 schrieb Tomas Lestach:
 Hello Johannes,
 
 On Friday 03 of August 2012 12:44:11 Johannes Renner wrote:
  Hi,
[...]
  So I am coming up with two patch proposals, since I am not really sure
  about how we are intended to solve the problem:
  
  - The first patch fixes it by calling elaborate() manually once
 
 I wouldn't call the elaborate method manually. Since the mechanism has
 worked till now, I'd rather revert my original commit.
 
 spacewalk.git: 43fbb66782bebe62e5aa323bc5edf70276d2609b
 
  - The second patch is a more generic fix and calls elaborate() in
BaseManager.java even if PageControl is null
 
 What is the bug you try to fix with the 2nd patch? Could you describe the 
 misbehavior on a concrete page?

Johannes is on vacation this week. I think he will answer as soon as he is 
back.

I am not a java expert, but if I remember correctly we set a breakpoint in the 
elaborator and this was never reached.

So our question was, if there is something wrong with the concept and the 
elaborator is never executed in this kind of usage.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] fix for wrong transaction name

2012-06-05 Thread Michael Calmer
Hi,

please have a look at the attached patch. I think this was a copy and paste 
bug, or is there a reason, why a transaction with a different name is rolled 
back than started?

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 6a1fcba3370deb52c6e12c1cdc08b75c7a1b7ede Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Tue, 5 Jun 2012 11:47:33 +0200
Subject: [PATCH] fix wrong transaction name in unsubscribe_channels

---
 backend/server/rhnChannel.py |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/backend/server/rhnChannel.py b/backend/server/rhnChannel.py
index 2c9aad7..a48bbf2 100644
--- a/backend/server/rhnChannel.py
+++ b/backend/server/rhnChannel.py
@@ -1846,7 +1846,7 @@ def unsubscribe_channels(server_id, channels):
 for channel in child_channels + base_channels:
 ret = unsubscribe_sql(server_id, channel[id], 0)
 if not ret:
-rhnSQL.rollback(unsub_all_channels)
+rhnSQL.rollback(unsub_channels)
 raise rhnFault(36, Could not unsubscribe server %s \
from channel %s % (server_id, channel[label]))
 
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] small license issues

2012-05-31 Thread Michael Calmer
Hi,

our legal guys reviewed the spacewalk packages and found some small issues 
which should be easy to verify and fix.

1) rhnpush declared GPL v2 but no COPYING file

Would you add a COPYING file please?


2) spacewalk-setup license mix

The spec file states that the package is licensed under GPLv2.
However, the README implies that the package is actually licensed under the 
same terms as Perl, means Artistic License.

If this is true please say in specfile GPLv2 or Artistic-1.0 and provide the
COPYING and the Artistic License files with the package.


3) spacewalk-reports declared GPLv2 but contains no COPYING file

Would you add a COPYING file please?


4) spacewalk-utils declared GPLv2 but contains GPL-3.0+ licensed script

Please verify and change the spec to GPLv2 and GPLv3+ and provide both COPYING 
files with the package.


That's all from my side :-)

Thanks.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] Show systems that need reboot because of an errata

2012-04-19 Thread Michael Calmer
Hi,

Am Mittwoch, 18. April 2012, 15:00:01 schrieb Tomas Lestach:
  Attached patch, rebased against master. It contains all suggestions and
  fixed some formatting issues not relevant to the patch. Additionally
  changed to_timestamp() to something that works in both databases.
  
  Duncan
 
 Thanks Duncan,
 
 I committed your patch as: 433bd3a310f38577ff3066414a2f035e4c310e47

It seems that one query is not able to run on oracle and on postgres
it does not do what it should :-)

A possible fix is attached.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From dfb7e3e922eee62b615ba1c1294560e85341dd78 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 19 Apr 2012 11:47:24 +0200
Subject: [PATCH] fix has_errata_with_keyword_applied_since_last_reboot query

Fixes:
com.redhat.rhn.common.db.WrappedSQLException: ORA-00936: missing expression
---
 .../common/db/datasource/xml/System_queries.xml|2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
index ace71cb..c05c98f 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
@@ -790,7 +790,6 @@ SELECT DISTINCT S.id, S.NAME,
 
 mode name=has_errata_with_keyword_applied_since_last_reboot
   query params=org_id, user_id, keyword, sid
-  SELECT EXISTS (
 	SELECT 1
 	FROM rhnServer S,
 	  rhnErrata E,
@@ -808,7 +807,6 @@ SELECT DISTINCT S.id, S.NAME,
 	  AND EP.errata_id = E.id AND EP.package_id = P.id
 	  AND (to_date('1970-01-01', '-MM-DD') + numtodsinterval(S.last_boot, 'second')) lt; SP.installtime
 	  AND E.id IN (SELECT EK.errata_id FROM rhnErrataKeyword EK WHERE EK.keyword = :keyword)
-)
 /query
 /mode
 
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] fixing dead links in list

2012-04-13 Thread Michael Calmer
Hi,

I found a page with links to not existing pages.

Overview = Subscription Management = Software Channel Entitlements =
 click on a number in Systems Subscribed column

You see a page with a list of all Systems which uses this entitlement, but
if you click on the Errata or Package Number you end up in a not existing 
page.

The attached patch should bring you to the java pages.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From d247d08ec753d7eac5ba38f8fe8bc472c4161974 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 13 Apr 2012 16:13:28 +0200
Subject: [PATCH] change links to existing pages

---
 web/html/network/systems/system_list |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/web/html/network/systems/system_list b/web/html/network/systems/system_list
index 2e36da1..368cb9f 100644
--- a/web/html/network/systems/system_list
+++ b/web/html/network/systems/system_list
@@ -30,10 +30,10 @@
   /rhn-require
 
   column name=Errata label=total_errata align=center width=5%
-url/network/systems/details/errata_list.pxt?sid={column:id}/url
+url/rhn/systems/details/ErrataList.do?sid={column:id}/url
   /column
   column name=Packages label=outdated_packages align=center width=5%
-url/network/systems/details/packages/upgrade.pxt?sid={column:id}/url
+url/rhn/systems/details/packages/UpgradableList.do?sid={column:id}/url
   /column
   column name=System label=server_name sort_by=1 align=left width=35%
 url/rhn/systems/details/Overview.do?sid={column:id}/url
-- 
1.7.3.4



signature.asc
Description: This is a digitally signed message part.
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCHES] two patches for SUSE support

2012-01-17 Thread Michael Calmer
Hi,

Am Dienstag, 17. Januar 2012, 10:54:45 schrieb Jan Pazdziora:
 On Mon, Jan 16, 2012 at 04:48:17PM +0100, Michael Calmer wrote:
 
[...] 
 Renamed in Spacewalk master and rhn-client-tools-1.7.5-1. Thanks for
 pointing this issue out.

Thanks. I have a new patch attached which define YumBaseError and RepoError 
also in SUSE.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 503627cdd9da6057c32658253c6f2c58451545ac Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 1 Dec 2011 16:58:02 +0100
Subject: [PATCH] implement YumBaseError and RepoError on ImportError if yum cannot be loaded

---
 .../src/up2date_client/up2dateErrors.py|   33 +++
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/client/rhel/rhn-client-tools/src/up2date_client/up2dateErrors.py b/client/rhel/rhn-client-tools/src/up2date_client/up2dateErrors.py
index 42a1ddb..0a0993b 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/up2dateErrors.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/up2dateErrors.py
@@ -14,18 +14,18 @@ _ = t.ugettext
 import OpenSSL
 import config
 from pkgplatform import getPlatform
+from platform import dist
 
-if getPlatform() == 'deb':
-RepoError = Error
+if getPlatform() == 'deb' or dist()[0] == 'SuSE':
 class YumBaseError(Exception):
 def __init__(self, errmsg):
 self.value = errmsg
-def __getattribute__(self, name):
+def __getattr__(self, name):
 raise AttributeError(_(class %s has no attribute '%s') % (self.__class__.__name__, name))
 def __setattr__(self, name, value):
 raise AttributeError(_(class %s has no attribute '%s') % (self.__class__.__name__, name))
 else:
-from yum.Errors import RepoError, YumBaseError
+from yum.Errors import YumBaseError
 
 class Error(YumBaseError):
 base class for errors
@@ -65,7 +65,12 @@ class Error(YumBaseError):
 YumBaseError.__setattr__(self, name, value)
 else:
 self.__dict__[name] = value
-
+
+if getPlatform() == 'deb' or dist()[0] == 'SuSE':
+RepoError = Error
+else:
+from yum.Errors import RepoError
+
 class RpmError(Error):
 rpm itself raised an error condition
 premsg = _(RPM error.  The message was:\n)
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCHES] two patches for SUSE support

2012-01-16 Thread Michael Calmer
Hi,

Am Donnerstag, 5. Januar 2012, 16:46:04 schrieb Miroslav Suchý:
 On 01/02/2012 04:30 PM, Michael Calmer wrote:
  Hi,
 
  happy new year.
 
  I have attached two small patches to imporove the SUSE client support.
 
  The first one is a general workaround for a not installed yum.
  Currently the classes are only defined if platform is deb, but also on
  SUSE
  with zypp plugin, yum is not installed.
  Additionally it fixes some python errors in the original code. You cannot
  assign a class which is defined later.
 
  The second one is a small patch to check for the zypp plugin and hide the
  warning about the not installed yum plugin.
 
 Second patch commited.
 
 I had mental problem with first patch. I do not like replacing 'if' by 
 'try/except'.
 This cover *why* we are doing that. Putting comment after that except 
 saying that debian and suse do not have this class... would be most 
 easier fix.
 But I would most rather see there
if getPlatform() == 'deb' or isThisSuse():

Ok, but looking into it more deeply I wonder how this can work. I cannot find 
a function called getPlatform() in the module platform (python 2.6/2.7) 

# python -c from platform import getPlatform
Traceback (most recent call last):
  File string, line 1, in module
ImportError: cannot import name getPlatform

There is a function platform() but this returns something like this:

 Linux-2.6.32.49-0.3-default-x86_64-with-SuSE-11-x86_64

I think it does not return only deb on debian.
 
Do you know where this getPlatform come from?

 BTW, how behaves zypper? If spacewalk code raise error, what is zypper 
 behavior? Yum will print nice error message, if that raised error is 
 instance of YumBaseError. If not, then yum will print full traceback.
 Does have zypper similar behaviour?

Not sure. The zypp plugin was developed by our zypp maintainers. Maybe Duncan 
can answer this question.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)


signature.asc
Description: This is a digitally signed message part.
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCHES] two patches for SUSE support

2012-01-16 Thread Michael Calmer
Hi,

Am Montag, 16. Januar 2012, 13:01:13 schrieb Jan Pazdziora:
 On Mon, Jan 16, 2012 at 12:15:26PM +0100, Michael Calmer wrote:
   easier fix.
   But I would most rather see there
  if getPlatform() == 'deb' or isThisSuse():
  
  Ok, but looking into it more deeply I wonder how this can work. I cannot
  find a function called getPlatform() in the module platform (python
  2.6/2.7) 
  
  # python -c from platform import getPlatform
  Traceback (most recent call last):
File string, line 1, in module
  ImportError: cannot import name getPlatform
  
  There is a function platform() but this returns something like this:
  
   Linux-2.6.32.49-0.3-default-x86_64-with-SuSE-11-x86_64
  
  I think it does not return only deb on debian.
   
  Do you know where this getPlatform come from?
 
 It's in
 
   client/rhel/rhn-client-tools/src/up2date_client/platform.py

Ahh, thanks. But this is bad. I would like to use the official platform module 
from python in the same file, but this result in namespace conflicts.
The first path in sys.path is . which means, that the result of

  from platform import dist

is a Traceback with ImportError: cannot import name dist

What do you think about renaming the up2date_client/platform.py to something 
like up2date_client/pkgplatform.py ?

Does anybody have other ideas how to solve this?

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)


signature.asc
Description: This is a digitally signed message part.
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCHES] another patch set fixing PG SQL statements and other things

2011-12-08 Thread Michael Calmer
Hi,

here is a list of small patches which fixes a lot of SQL statements for 
postgres.

0011-create-dir-if-it-does-not-exist.patch fixes a problem with not existing 
directory at rhnpush.

I found another small issue where I currently do not have a patch for. But I 
want to let you know about it. If view the user list in the web ui with 
spacewalk and postgres DB and you create a normal user (no roles assigned),
the role column in the overview list is empty. With Oracle DB there is a text 
(normal user) displayed.

The reason for this is a problem with the schema

common/views/rhnUsersInOrgOverview.sql has the line:

 select  coalesce(utcv.names, '(normal user)')

utcv.names is a column of view postgres/views/rhnUserTypeCommaView.sql which 
has

array_to_string( array(select utb.type_name
 from rhnUserTypeBase utb
 where utb.user_id = C.id), ', ' )

array_to_string result in an empty string, but coalesce react only on NULL

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 9d678c9dfbd94337a472eeaba298f45bd991af35 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 2 Dec 2011 14:49:51 +0100
Subject: [PATCH 01/11] convert decode to case

---
 web/modules/rhn/RHN/DB/ContactMethod.pm |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/web/modules/rhn/RHN/DB/ContactMethod.pm b/web/modules/rhn/RHN/DB/ContactMethod.pm
index e568ef4..c5ff920 100644
--- a/web/modules/rhn/RHN/DB/ContactMethod.pm
+++ b/web/modules/rhn/RHN/DB/ContactMethod.pm
@@ -327,7 +327,7 @@ sub has_probe_dependencies {
   my ($sth, $query);
 
   $query = EOQ;
-SELECT decode(count(*),0,0,1)
+SELECT CASE count(*) WHEN 0 THEN 0 ELSE 1 END
   FROM rhn_probe P, rhn_contact_group_members CGM
   WHEREP.contact_group_id = CGM.contact_group_id
   AND  CGM.member_contact_method_id = :method_id
-- 
1.7.3.4

From bad2d488df161db81c239156bb3d8631aed9ba7a Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 2 Dec 2011 14:58:25 +0100
Subject: [PATCH 02/11] No need to convert numeric values to upper.

Addressing
DBD::Pg::st execute failed: ERROR:  function upper(numeric) does not exist
---
 .../rhn/RHN/DB/DataSource/xml/Errata_queries.xml   |2 +-
 web/modules/rhn/RHN/DB/Errata.pm   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/web/modules/rhn/RHN/DB/DataSource/xml/Errata_queries.xml b/web/modules/rhn/RHN/DB/DataSource/xml/Errata_queries.xml
index f19c26b..ae9e3a6 100644
--- a/web/modules/rhn/RHN/DB/DataSource/xml/Errata_queries.xml
+++ b/web/modules/rhn/RHN/DB/DataSource/xml/Errata_queries.xml
@@ -7,7 +7,7 @@ SELECT  EBL.bug_id AS ID,
 EBL.href AS HREF
   FROM  rhnErrataBugList EBL
  WHERE  EBL.errata_id = :eid
-ORDER BY UPPER(EBL.bug_id)
+ORDER BY EBL.bug_id
   /query
 /mode
 
diff --git a/web/modules/rhn/RHN/DB/Errata.pm b/web/modules/rhn/RHN/DB/Errata.pm
index ad15b6a..8fb70ca 100644
--- a/web/modules/rhn/RHN/DB/Errata.pm
+++ b/web/modules/rhn/RHN/DB/Errata.pm
@@ -135,7 +135,7 @@ sub bugs_fixed {
 SELECT  EBL.bug_id, EBL.summary, EBL.href
   FROM  $bl_table EBL
  WHERE  EBL.errata_id = ?
-ORDER BY UPPER(EBL.bug_id)
+ORDER BY EBL.bug_id
 EOQ
 
   $sth = $dbh-prepare($query);
-- 
1.7.3.4

From 54f955f6374e6292971ffd80beec97ce2e6a7534 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Wed, 7 Dec 2011 12:47:21 +0100
Subject: [PATCH 07/11] use real table name rhn_check_probe

---
 monitoring/NPalert/AlertDB.pm |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/monitoring/NPalert/AlertDB.pm b/monitoring/NPalert/AlertDB.pm
index 07f196a..9ec714d 100644
--- a/monitoring/NPalert/AlertDB.pm
+++ b/monitoring/NPalert/AlertDB.pm
@@ -292,7 +292,7 @@ sub init_statements {
   );
   $self-dbprepare(
 'same_host_probes_from_probeid',
-select probe_id from check_probe where host_id in (select host_id from check_probe where probe_id = ?)
+select probe_id from rhn_check_probe where host_id in (select host_id from rhn_check_probe where probe_id = ?)
   );
   $self-dbprepare('dual', 'select * from dual');
 } ## end sub init_statements
-- 
1.7.3.4

From 8c74ba7f8c06ee6349247341d9ef3435a0ec2899 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 2 Dec 2011 15:17:09 +0100
Subject: [PATCH 03/11] set selinux_ctx to undef if it is empty

Addressing
IntegrityError: new row for relation rhnconfiginfo violates check constraint vn_rhnconfiginfo_selinux_ctx
---
 web/modules/rhn/RHN/DB/ConfigRevision.pm |8 ++--
 1 files changed, 6 insertions(+), 2

[Spacewalk-devel] lock_web_contact never return with postgres

2011-11-29 Thread Michael Calmer
Hi,

after a little debugging I found out that the following function never return 
in case of postgres is used:

package RHN::DB::User;
sub lock_web_contact()

It stops at this query:

 'SELECT * FROM web_contact WHERE id = :user_id FOR UPDATE'

It seems, that postgres support FOR UPDATE so I do not understand why it 
does not work.

http://www.postgresql.org/docs/9.0/static/sql-select.html#SQL-FOR-UPDATE-SHARE

Maybe DBD:Pg has trouble with it?

  $sth-execute_h(user_id = $params{uid}); 
does not return.

Does somebody has an idea?

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)


signature.asc
Description: This is a digitally signed message part.
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] some patches for monitoring on postgres and pylint findings

2011-11-29 Thread Michael Calmer
Hi,

Am Montag, 28. November 2011, 18:18:31 schrieb Miroslav Suchy:
 Dne 28.11.2011 17:33, Michael Calmer napsal(a):
  0004-replace-synonyms-with-real-table-names-and-change-sy.patch
 
 
   From ab387975796b4b04a4ccab2cd600f01d0b69db2a Mon Sep 17 00:00:00 2001
  From: Michael Calmerm...@suse.de
  Date: Mon, 28 Nov 2011 16:30:11 +0100
  Subject: [PATCH 4/6] replace synonyms with real table names and change
  sysdate to current_timestamp
 
 Hmm I would be happy to apply that part with s/sysdate/current_timestamp/
 
 But I have problem with that alias. Why replacing it only in one file. 
 It is presented in other files as well. I would welcome to remove it in 
 all files or keep it as is.

Attached are now 4 patches. One with only the sysdate=current_timestamp
and 3 with synonym replaces.

There are some other files uses synonyms, but it seems they are not part of a 
package (only available in git). So maybe a candidate to remove them?

monitoring/SputLite/lib/FetchCommands.pm
monitoring/SputLite/lib/UploadResults.pm
monitoring/SputLite/lib/CommandQueue.pm
monitoring/tsdb/cull_deleted_ts_sc_files

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From 6651001519ecd1b657a63d22d0dead7c7f21952a Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Tue, 29 Nov 2011 17:55:01 +0100
Subject: [PATCH 1/4] replace sysdate with current_timestamp

---
 monitoring/PerlModules/NP/OracleDB/CF_DB.pm |   22 +++---
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/monitoring/PerlModules/NP/OracleDB/CF_DB.pm b/monitoring/PerlModules/NP/OracleDB/CF_DB.pm
index 4d25b0d..032c109 100644
--- a/monitoring/PerlModules/NP/OracleDB/CF_DB.pm
+++ b/monitoring/PerlModules/NP/OracleDB/CF_DB.pm
@@ -100,7 +100,7 @@ sub CQ_Commands {
 $idnum = $rv-[0]-[0];
 unshift(@$whereclauses, '?');
 unshift(@$bindvars, $idnum);
-push(@$whereclauses, sprintf('%s', $self-username), 'sysdate');
+push(@$whereclauses, sprintf('%s', $self-username), 'current_timestamp');
 
   } elsif ($action eq 'select') {
 
@@ -158,7 +158,7 @@ sub CQ_Instances {
 $idnum = $rv-[0]-[0];
 unshift(@$whereclauses, '?');
 unshift(@$bindvars, $idnum);
-push(@$whereclauses, 'sysdate', sprintf('%s', $self-username), 'sysdate');
+push(@$whereclauses, 'current_timestamp', sprintf('%s', $self-username), 'current_timestamp');
 
   } elsif ($action eq 'select') {
 
@@ -212,7 +212,7 @@ sub CQ_Execs {
 
   } elsif ($action eq 'insert') {
 
-push(@$whereclauses, 'sysdate');
+push(@$whereclauses, 'current_timestamp');
 
   } elsif ($action eq 'select') {
 
@@ -289,7 +289,7 @@ sub CQ_Sessions {
 
   } elsif ($action eq 'insert') {
 
-push(@$whereclauses, sprintf('%s', $self-username), 'sysdate');
+push(@$whereclauses, sprintf('%s', $self-username), 'current_timestamp');
 
   } elsif ($action eq 'select') {
 
@@ -350,7 +350,7 @@ sub Customer {
 $idnum = $rv-[0]-[0];
 unshift(@$whereclauses, '?');
 unshift(@$bindvars, $idnum);
-push(@$whereclauses, sprintf('%s', $self-username), 'sysdate');
+push(@$whereclauses, sprintf('%s', $self-username), 'current_timestamp');
 
   } elsif ($action eq 'select') {
 
@@ -411,7 +411,7 @@ sub Netsaint {
 $idnum = $rv-[0]-[0];
 unshift(@$whereclauses, '?');
 unshift(@$bindvars, $idnum);
-push(@$whereclauses, sprintf('%s', $self-username), 'sysdate');
+push(@$whereclauses, sprintf('%s', $self-username), 'current_timestamp');
 
   } elsif ($action eq 'select') {
 
@@ -477,7 +477,7 @@ sub Node {
 $idnum = $rv-[0]-[0];
 unshift(@$whereclauses, '?');
 unshift(@$bindvars, $idnum);
-push(@$whereclauses, sprintf('%s', $self-username), 'sysdate');
+push(@$whereclauses, sprintf('%s', $self-username), 'current_timestamp');
 
   } elsif ($action eq 'select') {
 
@@ -580,7 +580,7 @@ sub Contact {
 $idnum = $rv-[0]-[0];
 unshift(@$whereclauses, '?');
 unshift(@$bindvars, $idnum);
-push(@$whereclauses, sprintf('%s', $self-username), 'sysdate');
+push(@$whereclauses, sprintf('%s', $self-username), 'current_timestamp');
 
   } elsif ($action eq 'select') {
 
@@ -820,7 +820,7 @@ sub getUnexpiredCQ_Execs_by_instance_netsaint {
   my @where= (netsaint_id = ?, 
   instance_id = ?,
 		  instance_id = ins.recid,
-		  expiration_date  sysdate);
+		  expiration_date  current_timestamp);
 
   my @bind = ($nsid, $iid); 
 
@@ -962,7 +962,7 @@ sub getUnexpiredCQ_SessionBySessionId {
 
   my($dataref, $ordref) = 
 $self-CQ_Sessions('select', ['session_id

[Spacewalk-devel] [PATCH] some patches for monitoring on postgres and pylint findings

2011-11-28 Thread Michael Calmer
Hi,

here are 6 patches I made. The first two were findings from pylint, the rest 
is a try to fix monitoring with postgres.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From ffc17d8bce7322d8108d55293dd6e411157d3196 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Sun, 27 Nov 2011 15:35:12 +0100
Subject: [PATCH 1/6] add missing import

 E:132,54:ConfigManagement.management_remove_channel: Undefined variable
'sys'
---
 .../handlers/config_mgmt/rhn_config_management.py  |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/backend/server/handlers/config_mgmt/rhn_config_management.py b/backend/server/handlers/config_mgmt/rhn_config_management.py
index d5287fc..ddf08c4 100644
--- a/backend/server/handlers/config_mgmt/rhn_config_management.py
+++ b/backend/server/handlers/config_mgmt/rhn_config_management.py
@@ -17,6 +17,7 @@
 #
 # $Id$
 
+import sys
 import difflib
 from spacewalk.common.rhnLog import log_debug
 from spacewalk.common.rhnException import rhnFault
-- 
1.7.3.4

From 74c1d950d06fdaf7edf75beb2b795e72b5933576 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Sun, 27 Nov 2011 15:36:23 +0100
Subject: [PATCH 2/6] fix typos in boolean variables

E:358,21:schedule_config_deploy: Undefined variable 'false'
E:361,29:schedule_config_deploy: Undefined variable 'true'
---
 backend/server/rhnServer/server_kickstart.py |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/backend/server/rhnServer/server_kickstart.py b/backend/server/rhnServer/server_kickstart.py
index a33389f..7ba167b 100644
--- a/backend/server/rhnServer/server_kickstart.py
+++ b/backend/server/rhnServer/server_kickstart.py
@@ -355,10 +355,10 @@ def schedule_config_deploy(server_id, action_id, kickstart_session_id,
 return aid
 else:
 tokens_obj = rhnFlags.get(registration_token)
-deployment = false
+deployment = False
 for token in tokens_obj.tokens:
 if token['deploy_configs'] == 'Y':
-deployment = true
+deployment = True
 break
 if not deployment:
 return aid
-- 
1.7.3.4

From 54a13d06af07a1d86cde69719aff3179b70d59a4 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 28 Nov 2011 16:13:43 +0100
Subject: [PATCH 3/6] specify missing param password

---
 client/tools/osad/src/osa_dispatcher.py |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/client/tools/osad/src/osa_dispatcher.py b/client/tools/osad/src/osa_dispatcher.py
index 9f207af..967c77b 100644
--- a/client/tools/osad/src/osa_dispatcher.py
+++ b/client/tools/osad/src/osa_dispatcher.py
@@ -270,7 +270,7 @@ class Runner(jabber_lib.Runner):
 )
 
 def _register_dispatcher(self, jabber_id, hostname, port):
-h = rhnSQL.prepare(self._query_register_dispatcher, params = ( 'hostname_in varchar', 'port_in numeric', 'jabber_id_in varchar' ))
+h = rhnSQL.prepare(self._query_register_dispatcher, params = ( 'hostname_in varchar', 'port_in numeric', 'jabber_id_in varchar', 'password varchar' ))
 h.execute(jabber_id_in=jabber_id, hostname_in=hostname, port_in=port, password=self._password)
 rhnSQL.commit()
 
-- 
1.7.3.4

From ab387975796b4b04a4ccab2cd600f01d0b69db2a Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 28 Nov 2011 16:30:11 +0100
Subject: [PATCH 4/6] replace synonyms with real table names and change sysdate to current_timestamp

---
 monitoring/PerlModules/NP/OracleDB/CF_DB.pm |   42 +-
 1 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/monitoring/PerlModules/NP/OracleDB/CF_DB.pm b/monitoring/PerlModules/NP/OracleDB/CF_DB.pm
index 4d25b0d..43a109b 100644
--- a/monitoring/PerlModules/NP/OracleDB/CF_DB.pm
+++ b/monitoring/PerlModules/NP/OracleDB/CF_DB.pm
@@ -80,7 +80,7 @@ sub CQ_Commands {
   my $bindvars  = shift || [];
   my $orderby   = shift || [];
 
-  my $table  = COMMAND_QUEUE_COMMANDS;
+  my $table  = RHN_COMMAND_QUEUE_COMMANDS;
   my $idseq  = COMMAND_Q_COMMAND_RECID_SEQ.NEXTVAL;
   my $keycol = 'RECID';
   my @cols   = qw(RECIDDESCRIPTION
@@ -100,7 +100,7 @@ sub CQ_Commands {
 $idnum = $rv-[0]-[0];
 unshift(@$whereclauses, '?');
 unshift(@$bindvars, $idnum);
-push(@$whereclauses, sprintf('%s', $self-username), 'sysdate');
+push(@$whereclauses, sprintf('%s', $self-username), 'current_timestamp');
 
   } elsif ($action eq 'select') {
 
@@ -140,7 +140,7 @@ sub CQ_Instances {
   my $bindvars  = shift || [];
   my $orderby

[Spacewalk-devel] [PATCH] parse V4 RSA/SHA gpg signature keyids correctly from RPM

2011-11-02 Thread Michael Calmer
Hi,

It seems that packages from packman are signed with V4 RSA/SHA which result in 
wrong keyids while importing packages.

Example RPM:

  http://packman.links2linux.de/download/yad/1024510/yad-0.15.0-1.1.x86_64.rpm

spacewalk/common/rhn_rpm.py _extract_signatures() find keyid:

 05024ea4a264000a

rpm -qpi ... say:
 warning: yad-0.15.0-1.1.x86_64.rpm: Header V4 RSA/SHA1 signature: NOKEY, 
  key ID 1abd1afb
 [...]
 Signature   : RSA/SHA1, Mo 24 Okt 2011 01:25:24 CEST, Key ID 45a1d0671abd1afb

A patch is attached

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From c74ee56448aace7ed8be8ae2a00c8f27ed901622 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Wed, 26 Oct 2011 17:19:27 +0200
Subject: [PATCH] support V4 RSA signatures

---
 backend/common/rhn_rpm.py |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/backend/common/rhn_rpm.py b/backend/common/rhn_rpm.py
index 42483f3..de11246 100644
--- a/backend/common/rhn_rpm.py
+++ b/backend/common/rhn_rpm.py
@@ -112,8 +112,10 @@ class RPM_Header:
 key_id = ret[9:17]
 elif ret_len = 72: # V4 DSA signature
 key_id = ret[18:26]
-else: # ret_len = 536 # V3 RSA/SHA256 signature
+elif ret_len = 536: # V3 RSA/SHA256 signature
 key_id = ret[10:18]
+else: # ret_len = 543 # V4 RSA/SHA signature
+key_id = ret[19:27]
 
 key_id_len = len(key_id)
 format = %dB % key_id_len
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] spacewalk with oracle 11.2 has problems with the monitoring code

2011-08-24 Thread Michael Calmer
Hi,

Am Mittwoch, 24. August 2011, 13:29:30 schrieb Miroslav Suchý:
 On 08/24/2011 01:05 PM, Michael Calmer wrote:
  Some monitoring code expect special columns with id 1 which fail if id 1 
  column does not exist.
  
  E.g:
  
java/code/src/com/redhat/rhn/domain/monitoring/satcluster/SatClusterFactory.java
  private static final PhysicalLocation PHYSICAL_LOCATION =
  lookupPhysicalLocation(new Long(1));
  
  A quick fix is, to disable this feature in oracle with:
  
   alter system set deferred_segment_creation=FALSE;
  
  but a real fix would be better.
 
 Requiring presence of row with id=1 is definitely bug.

100% agree

 I do not like that Oracle workaround. That code which lookup id=1 should
 be replaced. Patches are welcome. :)

I agree. The problem is, that there are a lot more places where this happens. 
To find out all these is a lot of work :-)

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)


signature.asc
Description: This is a digitally signed message part.
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] Has signed Metadata

2011-05-24 Thread Michael Calmer
Hi,

Am Montag, 21. März 2011, 15:56:50 schrieb Michael Mraka:
 Michael Calmer wrote:
 % Hi,
 ...
 % 
 % I would suggest, that we go step by step. So let's wait until weak deps
 % and 
 % updateinfo to errata is applied. After this I will submit a new patch
 % for this feature based on the new master.
 
 Sure, no problem.

I re-worked the patches now. 

spacewalk-repo-sync uses now a fix directory with a GPG keyring to store 
trusted keys. 

Please review. Thanks.

-- 
Regards

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
HRB 16746 (AG Nürnberg)
From d7c0e9d8ae3684566ae79573d1e8e369e2388323 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Sat, 21 May 2011 15:56:47 +0200
Subject: [PATCH 1/3] add column metadata_signed to rhnContentSource table

---
 .../spacewalk/common/tables/rhnContentSource.sql   |4 
 .../019-add-metadata_signed.sql|   16 
 2 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 schema/spacewalk/upgrade/spacewalk-schema-1.4-to-spacewalk-schema-1.5/019-add-metadata_signed.sql

diff --git a/schema/spacewalk/common/tables/rhnContentSource.sql b/schema/spacewalk/common/tables/rhnContentSource.sql
index dc93a27..2f36f2e 100644
--- a/schema/spacewalk/common/tables/rhnContentSource.sql
+++ b/schema/spacewalk/common/tables/rhnContentSource.sql
@@ -29,6 +29,10 @@ rhnContentSource
 references rhnContentSourceType(id),
 source_url  varchar2(512) NOT NULL,
 label   varchar2(64) NOT NULL,
+metadata_signed CHAR(1)
+DEFAULT ('N') NOT NULL
+CONSTRAINT rhn_cs_ms_ck
+CHECK (metadata_signed in ( 'Y' , 'N' )),
 created date default(sysdate) NOT NULL,
 modifieddate default(sysdate) NOT NULL
 )
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.4-to-spacewalk-schema-1.5/019-add-metadata_signed.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.4-to-spacewalk-schema-1.5/019-add-metadata_signed.sql
new file mode 100644
index 000..8839641
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.4-to-spacewalk-schema-1.5/019-add-metadata_signed.sql
@@ -0,0 +1,16 @@
+--
+-- Copyright (c) 2011 SUSE LINUX Products GmbH
+--
+-- 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.
+--
+--
+alter table rhnContentSource
+add metadata_signed char(1) default('N')
+constraint rhn_cs_ms_nn not null
+constraint rhn_cs_ms_ck
+check (metadata_signed in ('Y','N'));
-- 
1.7.3.4

From 77ea4ace147ac72ebc2834bb8954b53198278da5 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Sat, 21 May 2011 16:17:29 +0200
Subject: [PATCH 2/3] add has signed metadata checkbox to manage repositories page

---
 .../rhn/domain/channel/ContentSource.hbm.xml   |1 +
 .../redhat/rhn/domain/channel/ContentSource.java   |   17 
 .../channel/manage/repo/RepoDetailsAction.java |   16 +++
 .../frontend/strings/jsp/StringResource_en_US.xml  |3 ++
 .../rhn/manager/channel/repo/BaseRepoCommand.java  |   21 
 .../redhat/rhn/taskomatic/task/RepoSyncTask.java   |1 +
 .../pages/channel/manage/repo/repodetails.jsp  |8 +++
 java/code/webapp/WEB-INF/struts-config.xml |1 +
 8 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml b/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml
index 79ad517..39bf85f 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/channel/ContentSource.hbm.xml
@@ -17,6 +17,7 @@ PUBLIC -//Hibernate/Hibernate Mapping DTD 3.0//EN
 property name=created type=timestamp column=created  insert=false update=false /
 property name=modified type=timestamp column=modified insert=false update=false /
 property name=label type=string column=label/
+property name=metadataSigned type=yes_no column=metadata_signed/
 
 many-to-one name=org
  column=org_id
diff --git a/java/code/src/com/redhat/rhn/domain/channel/ContentSource.java b/java

Re: [Spacewalk-devel] [PATCH] build rhncfg on openSUSE

2011-04-15 Thread Michael Calmer
Hi,

Am Freitag, 8. April 2011, 14:57:56 schrieb Michael Calmer:
 Hi,
 
 here is the patch for rhncfg.
 
 0007-build-rhncfg-on-SUSE.patch:
 - only some specfile modifications

I splitted this into seperate patches. One SUSE specific and one general one
like you suggested. 

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From b31b81520f06693b299f962eb20bec4c4bd7d01a Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 14 Apr 2011 18:13:25 +0200
Subject: [PATCH 05/13] build rhncfg build on SUSE

- provide on SUSE missing directories
---
 client/tools/rhncfg/rhncfg.spec |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index 43384e6..f760038 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -17,7 +17,12 @@ BuildRequires: python
 Requires: python
 Requires: rhnlib = 2.5.32
 Requires: rhn-client-tools
+%if 0%{?suse_version}
+# provide rhn directories and no selinux on suse
+BuildRequires: rhn-client-tools
+%else
 Requires: libselinux-python
+%endif
 
 %description 
 The base libraries and functions needed by all rhncfg-* packages.
@@ -68,6 +73,9 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
+%if 0%{?suse_version}
+%dir %{_sharedstatedir}
+%endif
 %{rhnroot}/config_common
 %{_sharedstatedir}/rhncfg/backups
 %doc LICENSE PYTHON-LICENSES.txt
-- 
1.7.3.4

From 73cb7d7a4d15ddf533d537f3ec3bcfe016a88d3d Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 14 Apr 2011 18:24:47 +0200
Subject: [PATCH 06/13] add missing directories to filelist

---
 client/tools/rhncfg/rhncfg.spec |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index f760038..0d55a8b 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -76,6 +76,7 @@ rm -rf $RPM_BUILD_ROOT
 %if 0%{?suse_version}
 %dir %{_sharedstatedir}
 %endif
+%dir %{_sharedstatedir}/rhncfg
 %{rhnroot}/config_common
 %{_sharedstatedir}/rhncfg/backups
 %doc LICENSE PYTHON-LICENSES.txt
@@ -96,7 +97,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files actions
 %defattr(-,root,root,-)
-%{rhnroot}/actions/*
+%{rhnroot}/actions
 %{_bindir}/rhn-actions-control
 %config(noreplace) %{client_caps_dir}/*
 %{_mandir}/man8/rhn-actions-control.8*
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] build rhn-custom-info on openSUSE

2011-04-15 Thread Michael Calmer
Hi,

Am Montag, 11. April 2011, 16:58:21 schrieb Miroslav Suchý:
 On 04/08/2011 02:59 PM, Michael Calmer wrote:
  Hi,
  
  here is the patch to build rhn-custom-info on openSUSE.
  
  0008-build-rhn-custom-info-on-SUSE.patch:
  - only some specfile modifications
 
  %else
 +%if 0%{?suse_version}
 +Requires: zypp-plugin-spacewalk
 +%else
 
 I would much rather prefer usage of %elif here.

Hmm, rpm do not support %elif. It does not in OBS and we looked in the 
upstream code and also there is elif not implemented.
 
 +%dir %{_datadir}/rhn
 
 Again. rhn-custom-info requires yum-rhn-plugin, which requires
 rhn-client-tools, which own this directory. So this should not be there.

Ok, here is a modified version of the patch.

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 9fb215881dd38f79382a889e5dfdb02b244be1ff Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 15 Apr 2011 10:24:18 +0200
Subject: [PATCH 07/13] build rhn-custom-info on SUSE

- require zypp-plugin-spacewalk
- BuildRequire rhn-client-tools for the filelist check in OBS
---
 client/tools/rhncustominfo/rhn-custom-info.spec |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/client/tools/rhncustominfo/rhn-custom-info.spec b/client/tools/rhncustominfo/rhn-custom-info.spec
index 7d2e7813..da410d8 100644
--- a/client/tools/rhncustominfo/rhn-custom-info.spec
+++ b/client/tools/rhncustominfo/rhn-custom-info.spec
@@ -21,8 +21,15 @@ Requires: rhnlib
 %if 0%{?rhel} = 5 || 0%{?fedora} = 1
 Requires: yum-rhn-plugin
 %else
+# rpm do not support elif
+%if 0%{?suse_version}
+Requires: zypp-plugin-spacewalk
+# provide rhn directories for filelist check
+BuildRequires: rhn-client-tools
+%else
 Requires: up2date
 %endif
+%endif
 
 %description 
 Allows for the setting and listing of custom key/value pairs for 
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] build rhnpush on openSUSE

2011-04-15 Thread Michael Calmer
Hi,

Am Montag, 11. April 2011, 17:18:13 schrieb Miroslav Suchý:
 On 04/08/2011 03:01 PM, Michael Calmer wrote:
  Hi,
  
  here is the patch to build rhnpush on openSUSE.
  
  0009-build-rhnpush-on-SUSE.patch:
  - only some specfile modifications
 
 Applied only first part. And next time I would to see instead of
 - modify the specfile
 some better explanation why this is done. Well I from first line I know
 that it is because Suse build, but why? Do you receive some error in
 OBS. Do you get some Traceback. Or is it some kind of policy (link)?...
 
 The rest is as in previous commits. Directories are already owned by
 rhn-client-tools.

Here is the patch for the missing filelist issue with a short explanation
why we BuildRequire rhn-client-tools

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 7377dc046ff4a1bb2ad4eb480e5f0ba8ff40ccb6 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 15 Apr 2011 10:30:07 +0200
Subject: [PATCH 08/13] build rhnpush on SUSE

- BuildRequire rhn-client-tools to provide rhn directories for the
  filelist check in OBS
---
 client/tools/rhnpush/rhnpush.spec |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec
index 3d68847..220608c 100644
--- a/client/tools/rhnpush/rhnpush.spec
+++ b/client/tools/rhnpush/rhnpush.spec
@@ -18,6 +18,10 @@ Requires:  up2date
 %else
 Requires:  rhn-client-tools
 %endif
+%if 0%{?suse_version}
+# provides rhn directories for filelist check in OBS
+BuildRequires:  rhn-client-tools
+%endif
 BuildRequires: docbook-utils, gettext
 BuildRequires: python-devel
 
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] build spacewalk-koan on openSUSE

2011-04-15 Thread Michael Calmer
Hi,

Am Freitag, 8. April 2011, 15:12:19 schrieb Michael Calmer:
 Hi,
 
 here is the patch to build spacewalk-koan on openSUSE.
 
 0011-build-spacewalk-koan-on-SUSE.patch:
 - modify the specfile
 - require virtualization packages
   It seems, that code of spacewalk-koan import modules from 
   rhn-virtualization. So I added these requires to the specfile.
 
   Is there a special reason why it is not there, or simply forgot to add
   this requirement?

Attached is a new versoin of this patch, but without the Requires: rhn-
virtualization.

-- 
MFG

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 31124cc61c32c66f71f1842e212349936cbfac14 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 15 Apr 2011 11:50:44 +0200
Subject: [PATCH 10/13] build spacewalk-koan on SUSE

- BuildRequire rhn-client-tools to provide directories
  for filelist check in OBS
---
 client/tools/spacewalk-koan/spacewalk-koan.spec |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/client/tools/spacewalk-koan/spacewalk-koan.spec b/client/tools/spacewalk-koan/spacewalk-koan.spec
index 4af05c1..6bc2241 100644
--- a/client/tools/spacewalk-koan/spacewalk-koan.spec
+++ b/client/tools/spacewalk-koan/spacewalk-koan.spec
@@ -12,7 +12,10 @@ BuildArch:  noarch
 BuildRequires:  python
 Requires:   python = 1.5
 Requires:   koan = 1.4.3
-
+%if 0%{?suse_version}
+# provide directories for filelist check in OBS
+BuildRequires: rhn-client-tools
+%endif
 Conflicts: rhn-kickstart
 Conflicts: rhn-kickstart-common
 Conflicts: rhn-kickstart-virtualization
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] build spacewalk-remote-utils on openSUSE

2011-04-15 Thread Michael Calmer
Hi,

Am Freitag, 8. April 2011, 15:14:25 schrieb Michael Calmer:
 Hi,
 
 here is the patch to build spacewalk-remote-utils on openSUSE.
 
 0012-build-spacewalk-remote-utils-on-SUSE.patch
 - adding only one little dir to the filelist of the specfile

Attached is a new version of this patch. It now buildrequires rhn-client-tools 
to get the directories.

-- 
MFG

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 960aada71c92b06445868e62ef76b34f94df4ad7 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 15 Apr 2011 11:57:15 +0200
Subject: [PATCH 11/13] build spacewalk-remote-utils on SUSE

- BuildRequires rhn-client-tools to provide directories
  for filelist check in OBS
---
 .../spacewalk-remote-utils.spec|4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec b/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
index 8b0f770..cb76ac9 100644
--- a/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
+++ b/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
@@ -18,6 +18,10 @@ BuildArch:   noarch
 Requires:rhnlib = 2.5.38
 BuildRequires: python-devel
 BuildRequires: docbook-utils
+%if 0%{?suse_version}
+# provide directories for filelist check in OBS
+BuildRequires: rhn-client-tools
+%endif
 
 %description
 Utilities to interact with a RHN Satellite or Spacewalk server remotely over XMLRPC.
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] build rhnmd on openSUSE

2011-04-15 Thread Michael Calmer
Hi,

Am Freitag, 8. April 2011, 15:23:52 schrieb Michael Calmer:
 Hi,
 
 here is a patch to build rhnmd on openSUSE.
 
 0014-build-rhnmd-on-SUSE.patch
 - modify the specfile
 - add init script for openSUSE
 
 For SUSE I have removed the ssh key generation from the %post section.
 I added the generation into the SUSE init script. 
 The reason for this is, that if you do it in %post and use this RPM in an 
 appliance, you have the same ssh key on all copies of your appliance.
 
 Maybe you are interrested to do this also for RedHat / Fedora. 

I changed this patch and splited one more general thing out.

build rhnmd on SUSE

- add init script for SUSE
- BuildRequire sysconfig to make chkconfig work during build in OBS
- openssh-server does not exist on SUSE (part of openssh)
- no keygen in %post to use it in appliances
- create nocpulse user in a different way to make hime work on SUSE
  with openssh

add nocpulse config dir to filelist
I think rhnmd requires nothing which already provides this directory.

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From e27fbdae5bb9b67afbbb75a5b7487908791e787d Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 15 Apr 2011 12:09:51 +0200
Subject: [PATCH 12/13] build rhnmd on SUSE

- add init script for SUSE
- BuildRequire sysconfig to make chkconfig work during build in OBS
- openssh-server does not exist on SUSE (part of openssh)
- no keygen in %post to use it in appliances
- create nocpulse user in a different way to make hime work on SUSE
  with openssh
---
 monitoring/rhnmd/rhnmd.init.SUSE |  107 ++
 monitoring/rhnmd/rhnmd.spec  |   21 +++-
 2 files changed, 127 insertions(+), 1 deletions(-)
 create mode 100644 monitoring/rhnmd/rhnmd.init.SUSE

diff --git a/monitoring/rhnmd/rhnmd.init.SUSE b/monitoring/rhnmd/rhnmd.init.SUSE
new file mode 100644
index 000..a1662f6
--- /dev/null
+++ b/monitoring/rhnmd/rhnmd.init.SUSE
@@ -0,0 +1,107 @@
+#!/bin/bash
+#
+# Init file for rhnmd daemon
+#
+# chkconfig: 2345 99 1
+# description: rhnmd server daemon
+#
+# processname: rhnmd
+
+### BEGIN INIT INFO
+# Provides: rhnmd
+# Required-Start: $local_fs $network $remote_fs
+# Required-Stop: $local_fs $network $remote_fs
+# Default-Start: 3 5
+# Default-Stop: 0 1 6
+# Short-Description: rhnmd server daemon
+# Description: Provides wrapper around sshd
+#   so NOCpulse monitoring can connect to your machine
+#   and run probes, which requires local account.
+### END INIT INFO
+
+# source function library
+. /etc/rc.status
+
+prog=rhnmd
+
+# Some functions to make the below more readable
+SU=/bin/su -s /bin/bash - nocpulse -c
+SSHD=/usr/sbin/rhnmd
+SSHD_PIDFILE=/var/run/rhnmd.pid
+
+do_restart_sanity_check()
+{
+	$SU $SSHD -t -f /etc/nocpulse/rhnmd_config
+	RETVAL=$?
+	if [ ! $RETVAL = 0 ]; then
+		rc_failed
+		echo Configuration file or keys are invalid
+	fi
+}
+
+start()
+{
+	echo -n $Starting $prog:
+	IDENTITY=/var/lib/nocpulse/.ssh/nocpulse-identity
+	if [ ! -f $IDENTITY ]
+	then
+		/bin/su -s /bin/bash -c /usr/bin/ssh-keygen -q -t dsa -N '' -f $IDENTITY - nocpulse
+		if [ ! -e /var/lib/nocpulse/.bashrc ]; then
+			echo 'LANG=C'  /var/lib/nocpulse/.bashrc
+		fi
+	fi
+	startproc -p $SSHD_PIDFILE $SSHD -f /etc/nocpulse/rhnmd_config -o PidFile=$SSHD_PIDFILE
+	rc_status
+	touch /var/lock/subsys/rhnmd
+	rc_status -v
+}
+
+stop()
+{
+	echo -n $Stopping $prog:
+	rm -f /var/lock/subsys/rhnmd
+	killproc -p $SSHD_PIDFILE -TERM $SSHD
+rc_status -v
+}
+
+reload()
+{
+	echo -n $Reloading $prog:
+	killproc -p $SSHD_PIDFILE -HUP $SSHD
+	rc_status -v
+}
+
+case $1 in
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	restart)
+		stop
+		start
+		;;
+	reload)
+		reload
+		;;
+	condrestart|try-restart)
+		if [ -f /var/lock/subsys/rhnmd ] ; then
+			do_restart_sanity_check
+			if [ $RETVAL = 0 ] ; then
+stop
+# avoid race
+sleep 3
+start
+			fi
+		fi
+		;;
+	status)
+	echo -n Checking for service rhnmd: 
+		checkproc -p $SSHD_PIDFILE $SSHD
+		rc_status -v
+		;;
+	*)
+		echo $Usage: $0 {start|stop|restart|reload|condrestart|status}
+esac
+rc_exit
diff --git a/monitoring/rhnmd/rhnmd.spec b/monitoring/rhnmd/rhnmd.spec
index 6779bb5..93f85bb 100644
--- a/monitoring/rhnmd/rhnmd.spec
+++ b/monitoring/rhnmd/rhnmd.spec
@@ -14,7 +14,13 @@ License:GPLv2
 BuildArch:  noarch
 Group:  System Environment/Daemons
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires:   openssh-server openssh
+Requires:   openssh
+%if 0%{?suse_version}
+# make chkconfig work during build
+BuildRequires:  sysconfig

Re: [Spacewalk-devel] [PATCH] build rhn-client-tools on openSUSE

2011-04-15 Thread Michael Calmer
Hi,

Am Donnerstag, 14. April 2011, 11:05:09 schrieb Miroslav Suchý:
 On 04/14/2011 10:27 AM, Michael Calmer wrote:

[...]

  When do you need to know the project name for 
  the announcement?
 
 It will be nice if you can provide me with url and project name soon
 (read as tomorrow, or at Monday) and you can build the packages later
 there. I will let you know at least one day before release.

I have created  systemsmanagement:spacewalk:1.4 project in OBS

The repository URL is:

for openSUSE 11.4 (i586 and x86_64):
http://download.opensuse.org/repositories/systemsmanagement:/spacewalk:/1.4/openSUSE_11.4/

for openSUSE Factory(i586 and x86_64):
http://download.opensuse.org/repositories/systemsmanagement:/spacewalk:/1.4/openSUSE_Factory/

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] [PATCH] support for weak dependencies

2011-04-15 Thread Michael Calmer
Hi,

Am Freitag, 15. April 2011, 16:04:42 schrieb Jan Pazdziora:
 On Fri, Mar 11, 2011 at 05:21:50PM +0100, Michael Calmer wrote:
  Hi,
  
  Am Mittwoch, 9. März 2011, 12:21:41 schrieb Jan Pazdziora:
   On Wed, Mar 09, 2011 at 11:11:08AM +0100, Jan Pazdziora wrote:
On Mon, Mar 07, 2011 at 01:24:54PM +0100, Michael Calmer wrote:
 Hello,
  [...]
Could you please investigate? Do you need list of rpms I have
installed or something?
  
  I reworked the patchset:
  - removed the trailing whitespaces
  - fix the missing RPMTAG names bug (patch 0006)
 
 I've committed the patches to master now and tagged the respective
 packages. I'm sorry it got burried for so long.

np
 
 I've shifted the schema upgrade scripts to *-1.5 directory as
 Spacewalk 1.4 was already branched. I had to fix the SHA1 values
 in PostgreSQL sources -- you might want to do
 
   ( cd schema/spacewalk  perl schema-source-sanity-check.pl )
 
 to check that the schema sources look sane. It's actually necessary to
 do that because the rpm build would fail otherwise.

ok, thanks.

-- 
MFG

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] [PATCH] build rhn-client-tools on openSUSE

2011-04-14 Thread Michael Calmer
Hi,

Am Dienstag, 12. April 2011, 21:49:48 schrieb Miroslav Suchy:
 Dne 8.4.2011 14:49, Michael Calmer napsal(a):
  I spend the last week to build the spacewalk client tools on openSUSE and
  create a project in openSUSE build service.
 
http://download.opensuse.org/repositories/systemsmanagement:/spacewalk/
 
  It is based on current git master and I want to provide you the patches.
 
 Can I use it official announcement of Spacewalk 1.4 as repo for SUSE 
 clients? Or in another words: are you willing to maintain it.

Yes, I am willing to maintain it.
 
 And are you planing to update it against master more often (similar to 
 nightly) or want to update it just on every release of Spacewalk. If the 
 former is true, then it will be better to have another project which 
 will contains packages which are/will be release in Spacewalk release.

I think I will use systemsmanagement:spacewalk as master and will do more 
often an update to current git master. 

I want to create a subproject for 1.4 which should be based on SPACEWALK-1.4 
branch. 

Do you have a deadline for 1.4? When do you need to know the project name for 
the announcement?

-- 
MFG

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] build rhn-client-tools on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

I spend the last week to build the spacewalk client tools on openSUSE and 
create a project in openSUSE build service.

 http://download.opensuse.org/repositories/systemsmanagement:/spacewalk/

It is based on current git master and I want to provide you the patches.
Mainly I modified the specfile to get the different RPM names for SUSE in it.
Additionally the services got a SUSE specific specfile which is used, if the
package compiles on a SUSE distribution. 
If you prefer a LSB specfile which run on RedHat,Fedora and SUSE, please tell 
me. I will try to create one and I hope you can help to test them on Fedora 
and RedHat.

I will write a seperate mail for every package which hopefully helps to manage 
the answers and comments easier.

rhn-client-tools:

0001-get-hostname-on-not-RedHat-systems.patch:
On SUSE /etc/sysconfig/network is a directory and not a file which contains 
the hostname. So I added a check if it is a file and use the following code to 
find the hostname. Another special thing on SUSE is, that gethostbyname return 
only the (short) hostname, not the FQDN. Therefor I added a test, if hostname 
contains a .. If not, find the hostname using the socket class.

0002-enhance-getOSVersionAndRelease-to-find-SUSE-distribu.patch:
Add code to make _getOSVerionAndRelease work on SUSE

0003-modify-spec-file-to-build-on-SUSE.patch:
Specfile work. Use SUSE rpm names and add some directories to the filelist 
which does not exist on SUSE or does not exist during build.

0004-Check-if-system_id-has-changed.patch:
up2dateAuth.readCachedLogin() seems not to check, if the systemid has changed 
and the cache file is invalid. 

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 59d44ce683dbfc933baeec4bf92a4a415c225936 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 11:10:55 +0200
Subject: [PATCH 01/17] get hostname on not RedHat systems

Other Linux distributions may not have a file named /etc/sysconfig/network.
So we should check if it is a file and use the other methods to
find the hostname.
Additionally let's check if the found hostname contains a . .
If not, let's find the hostname by Route.
---
 .../src/up2date_client/hardware.py |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
index ca80e5b..f299bc2 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
@@ -429,13 +429,13 @@ def findHostByRoute():
 except:
 s.close()
 continue
-
-# Override hostname with the one in /etc/sysconfig/network 
+
+# Override hostname with the one in /etc/sysconfig/network
 # for bz# 457953
-
-if os.access(/etc/sysconfig/network, os.R_OK):
+
+if  os.path.isfile(/etc/sysconfig/network) and os.access(/etc/sysconfig/network, os.R_OK):
 	networkinfo = open(/etc/sysconfig/network, r).readlines()
-	
+
 for info in networkinfo:
 if not len(info):
 continue
@@ -489,10 +489,11 @@ def read_network():
 
 
 if netdict['hostname'] == 'localhost.localdomain' or \
+. not in netdict['hostname'] or \
 netdict['ipaddr'] == 127.0.0.1:
 hostname, ipaddr = findHostByRoute()
 
-if netdict['hostname'] == 'localhost.localdomain':
+if netdict['hostname'] == 'localhost.localdomain' or . not in netdict['hostname']:
 netdict['hostname'] = hostname
 if netdict['ipaddr'] == 127.0.0.1:
 netdict['ipaddr'] = ipaddr
-- 
1.7.3.4

From 39a69260d0bafc78b3bb8c6dba7dd25031821893 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 11:12:46 +0200
Subject: [PATCH 03/17] modify spec file to build on SUSE

---
 client/rhel/rhn-client-tools/rhn-client-tools.spec |   45 +++-
 1 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index dfe8f5f..0a061a2 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -22,17 +22,30 @@ Requires: python-ethtool = 0.4
 %endif
 Requires: gnupg
 Requires: sh-utils
+%if 0%{?suse_version}
+Requires: dbus-1-python
+%else
 Requires: dbus-python
+%endif
 %if 0%{?fedora}  12 || 0%{?rhel}  5
 Requires: python-gudev
 Requires: python-hwdata
 %else
 Requires: hal = 0.5.8.1-52
 %endif
+%if 0%{?suse_version

[Spacewalk-devel] [PATCH] build rhnsd on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build and run rhnsd on openSUSE.

0005-changes-to-build-rhnsd-on-SUSE.patch:
- specfile work
- provide SUSE init script 

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 74c43ea440c79538a4b290aac5040ac5bc39c547 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 14:27:53 +0200
Subject: [PATCH 05/17] changes to build rhnsd on SUSE

- modify specfile
- add and install init script for SUSE
---
 client/rhel/rhnsd/rhnsd.init.SUSE |  114 +
 client/rhel/rhnsd/rhnsd.spec  |   15 -
 2 files changed, 127 insertions(+), 2 deletions(-)
 create mode 100644 client/rhel/rhnsd/rhnsd.init.SUSE

diff --git a/client/rhel/rhnsd/rhnsd.init.SUSE b/client/rhel/rhnsd/rhnsd.init.SUSE
new file mode 100644
index 000..e2faf8e
--- /dev/null
+++ b/client/rhel/rhnsd/rhnsd.init.SUSE
@@ -0,0 +1,114 @@
+#!/bin/sh
+#
+# rhnsd:	Starts the Red Hat Network Daemon
+#
+# chkconfig: 345 97 03
+# description:  This is a daemon which handles the task of connecting \
+#		periodically to the Red Hat Network servers to \
+#		check for updates, notifications and perform system \
+#		monitoring tasks according to the service level that \
+#		this server is subscribed for
+#
+# processname: rhnsd
+# pidfile: /var/run/rhnsd.pid
+#
+
+### BEGIN INIT INFO
+# Provides: rhnsd
+# Required-Start: $local_fs $network $remote_fs $named $time
+# Required-Stop: $local_fs $network $remote_fs $named
+# Default-Start: 2 3 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts the Red Hat Network Daemon
+# Description: This is a daemon which handles the task of connecting
+#   periodically to the Red Hat Network servers to
+#   check for updates, notifications and perform system
+#   monitoring tasks according to the service level that
+#   this server is subscribed for.
+### END INIT INFO
+
+
+# interval in minutes to connect to Red Hat Network. The minimum allowed
+# value is currently 1 hour; by default rhnsd will connect every four hours.
+# This should be more than suitable for the vast majority of systems.  You
+# may adjust the interval by editing the file /etc/sysconfig/rhn/rhnsd.
+
+RHNSD=/usr/sbin/rhnsd
+RHNSD_PIDFILE=/var/run/rhnsd.pid
+
+# Sanity checks.
+[ -x $RHNSD ] || exit 6
+RHN_UP2DATE_FILE=/etc/sysconfig/rhn/up2date
+[ -f $RHN_UP2DATE_FILE ] || exit 6
+if [ -r $RHN_UP2DATE_FILE ]; then
+RHN_SYSTEMID_FILE=`awk -F '=[[:space:]]*' '/^[[:space:]]*systemIdPath[[:space:]]*=/ {print $2}' $RHN_UP2DATE_FILE`
+[ -f $RHN_SYSTEMID_FILE ] || exit 6
+elif [ $1 != status ];  then
+echo Insufficient privilege. Cannot open file $RHN_UP2DATE_FILE for reading.
+exit 4
+fi
+
+# Source function library.
+. /etc/rc.status
+
+# Shell functions sourced from /etc/rc.status:
+#  rc_check check and set local and overall rc status
+#  rc_statuscheck and set local and overall rc status
+#  rc_status -v ditto but be verbose in local rc status
+#  rc_status -v -r  ditto and clear the local rc status
+#  rc_failedset local and overall rc status to failed
+#  rc_reset clear local rc status (overall remains)
+#  rc_exit  exit appropriate to overall rc status
+
+# First reset status of this service
+rc_reset
+
+start() {
+echo -n $Starting Red Hat Network Daemon: 
+startproc -p $RHNSD_PIDFILE $RHNSD
+rc_status
+touch /var/lock/subsys/rhnsd
+rc_status -v
+}
+
+stop() {
+echo -n $Stopping Red Hat Network Daemon: 
+killproc -p $RHNSD_PIDFILE $RHNSD
+rc_status -v
+rm -f /var/lock/subsys/rhnsd
+}
+
+# See how we were called.
+case $1 in
+start)
+	start
+	;;
+stop)
+	stop
+	;;
+status)
+echo -n Checking for service rhnsd: 
+checkproc -p $RHNSD_PIDFILE $RHNSD
+	rc_status -v
+;;
+restart|force-reload)
+	stop
+	start
+	;;
+condrestart|try-restart)
+	if [ -f /var/lock/subsys/rhnsd ]; then
+	stop
+	start
+	fi
+	;;
+reload)
+echo -n $Reloading Red Hat Network Daemon: 
+killproc -p $RHNSD_PIDFILE -HUP $RHNSD
+rc_status -v
+echo
+;;
+*)
+	echo $Usage: $0 {start|stop|status|restart|force-reload|condrestart|try-restart|reload}
+exit 2
+esac
+rc_exit
diff --git a/client/rhel/rhnsd/rhnsd.spec b/client/rhel/rhnsd/rhnsd.spec
index bf99b51..ea566e4 100644
--- a/client/rhel/rhnsd/rhnsd.spec
+++ b/client/rhel/rhnsd/rhnsd.spec
@@ -11,11 +11,17 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: gettext
 
 Requires

[Spacewalk-devel] [PATCH] build osad on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build and run osad on openSUSE.

0006-build-osad-on-SUSE.patch:
- specfile work
- add init script for SUSE
- osad.py missed and import of the config module

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 17423372daefefabeb43a68b921dd665196adc86 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 15:17:06 +0200
Subject: [PATCH 06/17] build osad on SUSE

- modify specfile
- add init script for SUSE
---
 client/tools/osad/osad.spec  |   57 +++--
 client/tools/osad/prog.init.SUSE |   75 ++
 client/tools/osad/src/osad.py|1 +
 3 files changed, 129 insertions(+), 4 deletions(-)
 create mode 100755 client/tools/osad/prog.init.SUSE

diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 80cb6ab..285d30e 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -3,6 +3,14 @@
 %define client_caps_dir /etc/sysconfig/rhn/clientCaps.d
 %{!?pythongen:%define pythongen %(%{__python} -c import sys ; print sys.version[:3])}
 
+%if 0%{?suse_version}
+%define apache_group www
+%define include_selinux_package 0
+%else
+%define apache_group apache
+%define include_selinux_package 1
+%endif
+
 Name: osad
 Summary: Open Source Architecture Daemon
 Group:   System Environment/Daemons
@@ -17,22 +25,32 @@ BuildRequires: python-devel
 Requires: python
 Requires: rhnlib = 2.5.38
 Requires: jabberpy
-%if 0%{?rhel} = 5
+%if 0%{?rhel}  0%{?rhel} = 5
 Requires: python-hashlib
 %endif
 # This should have been required by rhnlib
+%if 0%{?suse_version} = 1140
+Requires: python-xml
+%else
 Requires: PyXML
+%endif
 %if %{pythongen} == 1.5
 Requires: python-iconv
 %endif
 Conflicts: osa-dispatcher  %{version}-%{release}
 Conflicts: osa-dispatcher  %{version}-%{release}
+%if !0%{?suse_version}
 Requires(post): chkconfig
 Requires(preun): chkconfig
 # This is for /sbin/service
 Requires(preun): initscripts
+%else
+Requires(post): aaa_base
+Requires(preun): aaa_base
+BuildRequires: sysconfig syslog
+%endif
 
-%description 
+%description
 OSAD agent receives commands over jabber protocol from Spacewalk Server and
 commands are instantly executed.
 
@@ -47,16 +65,24 @@ Requires: jabberpy
 Requires: lsof
 Conflicts: %{name}  %{version}-%{release}
 Conflicts: %{name}  %{version}-%{release}
+%if !0%{?suse_version}
 Requires(post): chkconfig
 Requires(preun): chkconfig
 # This is for /sbin/service
 Requires(preun): initscripts
+%else
+Requires(post): aaa_base
+Requires(preun): aaa_base
+Requires: logrotate
+BuildRequires: sysconfig
+%endif
 
 %description -n osa-dispatcher
 OSA dispatcher is supposed to run on the Spacewalk server. It gets information
 from the Spacewalk server that some command needs to be execute on the client;
 that message is transported via jabber protocol to OSAD agent on the clients.
 
+%if 0%{?include_selinux_package}
 %package -n osa-dispatcher-selinux
 %define selinux_variants mls strict targeted
 %define selinux_policyver %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' /usr/share/selinux/devel/policyhelp 2 /dev/null)
@@ -83,13 +109,18 @@ Requires: osa-dispatcher
 
 %description -n osa-dispatcher-selinux
 SELinux policy module supporting osa-dispatcher.
+%endif
 
 %prep
 %setup -q
+%if 0%{?suse_version}
+cp prog.init.SUSE prog.init
+%endif
 
 %build
 make -f Makefile.osad all
 
+%if 0%{?include_selinux_package}
 %{__perl} -i -pe 'BEGIN { $VER = join ., grep /^\d+$/, split /\./, %{version}.%{release}; } s!\@\@VERSION\@\@!$VER!g;' osa-dispatcher-selinux/%{modulename}.te
 for selinuxvariant in %{selinux_variants}
 do
@@ -97,12 +128,14 @@ do
 mv osa-dispatcher-selinux/%{modulename}.pp osa-dispatcher-selinux/%{modulename}.pp.${selinuxvariant}
 make -C osa-dispatcher-selinux NAME=${selinuxvariant} -f /usr/share/selinux/devel/Makefile clean
 done
+%endif
 
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT%{rhnroot}
-make -f Makefile.osad install PREFIX=$RPM_BUILD_ROOT ROOT=%{rhnroot}
+make -f Makefile.osad install PREFIX=$RPM_BUILD_ROOT ROOT=%{rhnroot} INITDIR=%{_initrddir}
 
+%if 0%{?include_selinux_package}
 for selinuxvariant in %{selinux_variants}
   do
 install -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}
@@ -121,6 +154,7 @@ install -p -m 644 osa-dispatcher-selinux/%{modulename}.if \
 # Install osa-dispatcher-selinux-enable which will be called in %post
 install -d %{buildroot}%{_sbindir}
 install -p -m 755 osa-dispatcher-selinux/osa-dispatcher-selinux-enable %{buildroot}%{_sbindir}/osa-dispatcher-selinux-enable
+%endif
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -147,6

[Spacewalk-devel] [PATCH] build rhncfg on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch for rhncfg.

0007-build-rhncfg-on-SUSE.patch:
- only some specfile modifications

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From e121739043aef3810620b7a5a3d0c8d4206e7bea Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 15:53:50 +0200
Subject: [PATCH 07/17] build rhncfg on SUSE

- modify specfile
---
 client/tools/rhncfg/rhncfg.spec |   12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index cd92e13..4965430 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -21,8 +21,10 @@ Requires: rhnlib = 2.5.32
 Requires: up2date
 %else
 Requires: rhn-client-tools
+%if 0%{?rhel}
 Requires: libselinux-python
 %endif
+%endif
 
 %description 
 The base libraries and functions needed by all rhncfg-* packages.
@@ -73,12 +75,17 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
+%dir %{rhnroot}
+%dir %{_sharedstatedir}
+%dir %{_sharedstatedir}/rhncfg
+%dir %{_sharedstatedir}/rhncfg/backups
 %{rhnroot}/config_common
 %{_sharedstatedir}/rhncfg/backups
 %doc LICENSE PYTHON-LICENSES.txt
 
 %files client
 %defattr(-,root,root,-)
+%dir %{rhnconf}
 %{rhnroot}/config_client
 %{_bindir}/rhncfg-client
 %attr(644,root,root) %config(noreplace) %{rhnconf}/rhncfg-client.conf
@@ -86,6 +93,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files management
 %defattr(-,root,root,-)
+%dir %{rhnconf}
 %{rhnroot}/config_management
 %{_bindir}/rhncfg-manager
 %attr(644,root,root) %config(noreplace) %{rhnconf}/rhncfg-manager.conf
@@ -93,7 +101,9 @@ rm -rf $RPM_BUILD_ROOT
 
 %files actions
 %defattr(-,root,root,-)
-%{rhnroot}/actions/*
+%dir %{rhnconf}
+%dir %{client_caps_dir}
+%{rhnroot}/actions
 %{_bindir}/rhn-actions-control
 %config(noreplace) %{client_caps_dir}/*
 %{_mandir}/man8/rhn-actions-control.8*
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] build rhn-custom-info on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build rhn-custom-info on openSUSE.

0008-build-rhn-custom-info-on-SUSE.patch:
- only some specfile modifications

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From f6aab93e04de6dbcb18bc27b2b75cc1f8b0cb1a7 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 16:13:39 +0200
Subject: [PATCH 08/17] build rhn-custom-info on SUSE

- modify the specfile
---
 client/tools/rhncustominfo/rhn-custom-info.spec |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/client/tools/rhncustominfo/rhn-custom-info.spec b/client/tools/rhncustominfo/rhn-custom-info.spec
index e6adbf5..f1638e5 100644
--- a/client/tools/rhncustominfo/rhn-custom-info.spec
+++ b/client/tools/rhncustominfo/rhn-custom-info.spec
@@ -21,8 +21,12 @@ Requires: rhnlib
 %if 0%{?rhel} = 5 || 0%{?fedora} = 1
 Requires: yum-rhn-plugin
 %else
+%if 0%{?suse_version}
+Requires: zypp-plugin-spacewalk
+%else
 Requires: up2date
 %endif
+%endif
 
 %description 
 Allows for the setting and listing of custom key/value pairs for 
@@ -46,6 +50,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
+%dir %{_datadir}/rhn
 %{_bindir}/rhn-custom-info
 %dir %{_datadir}/rhn/custominfo
 %{_datadir}/rhn/custominfo/rhn-custom-info.py*
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] build rhnpush on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build rhnpush on openSUSE.

0009-build-rhnpush-on-SUSE.patch:
- only some specfile modifications

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From ae5b4c241c5937c0560f7cca3b190e4b1b32e00f Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 16:26:21 +0200
Subject: [PATCH 09/17] build rhnpush on SUSE

- modify the specfile
---
 client/tools/rhnpush/rhnpush.spec |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec
index 43f0008..b81784e 100644
--- a/client/tools/rhnpush/rhnpush.spec
+++ b/client/tools/rhnpush/rhnpush.spec
@@ -19,6 +19,7 @@ Requires:  up2date
 Requires:  rhn-client-tools
 %endif
 BuildRequires: docbook-utils, gettext
+BuildRequires: python-devel
 
 Summary: Package uploader for the Red Hat Network Satellite Server
 
@@ -46,6 +47,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root)
+%dir %{rhnroot}
+%dir %{_sysconfdir}/sysconfig/rhn
 %dir %{rhnroot}/rhnpush
 %{rhnroot}/rhnpush/*
 %attr(755,root,root) %{_bindir}/rhnpush
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] build rhn-virtualization on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build rhn-virtualization on openSUSE.

0010-build-rhn-virtualization-on-SUSE.patch:
- modify the specfile
- add SUSE init script

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 2546d27a7edbf2c4ae2235e2c64220db60bdb95a Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 17:09:19 +0200
Subject: [PATCH 10/17] build rhn-virtualization on SUSE

- modify the specfile
- add SUSE init script
---
 .../rhn-virtualization/rhn-virtualization.spec |   28 +-
 .../scripts/rhn-virtualization-host.SUSE   |  113 
 2 files changed, 138 insertions(+), 3 deletions(-)
 create mode 100755 client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE

diff --git a/client/tools/rhn-virtualization/rhn-virtualization.spec b/client/tools/rhn-virtualization/rhn-virtualization.spec
index e9b7bf6..fab0e8b 100644
--- a/client/tools/rhn-virtualization/rhn-virtualization.spec
+++ b/client/tools/rhn-virtualization/rhn-virtualization.spec
@@ -15,6 +15,9 @@ Release:1%{?dist}
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:  noarch
 BuildRequires:  python
+%if 0%{?suse_version}
+BuildRequires: sysconfig syslog
+%endif
 
 %description
 rhn-virtualization provides various RHN/Spacewalk actions for manipulation 
@@ -24,7 +27,9 @@ virtual machine guest images.
 Summary: Files needed by rhn-virtualization-host
 Group: System Environment/Base
 Requires: rhn-client-tools
+%if !0%{?suse_version}
 Requires: chkconfig
+%endif
 
 %description common
 This package contains files that are needed by the rhn-virtualization-host
@@ -35,7 +40,11 @@ Summary: RHN/Spacewalk Virtualization support specific to the Host system
 Group: System Environment/Base
 Requires: libvirt-python
 Requires: rhn-virtualization-common = %{version}-%{release}
+%if 0%{?suse_version}
+Requires: cron
+%else
 Requires: /usr/sbin/crond
+%endif
 %if 0%{?rhel}  0%{?rhel}  6
 # in RHEL5 we need libvirt, but in RHEV@RHEL5 there should not be libvirt
 # as there is vdsm and bunch of other packages, but we have no clue how to
@@ -51,7 +60,9 @@ that is specific to the Host system (a.k.a. Dom0).
 
 %prep
 %setup -q
-
+%if 0%{?suse_version}
+cp scripts/rhn-virtualization-host.SUSE scripts/rhn-virtualization-host
+%endif
 
 %build
 make -f Makefile.rhn-virtualization
@@ -59,25 +70,35 @@ make -f Makefile.rhn-virtualization
 
 %install
 rm -rf $RPM_BUILD_ROOT
-make -f Makefile.rhn-virtualization DESTDIR=$RPM_BUILD_ROOT install
+make -f Makefile.rhn-virtualization DESTDIR=$RPM_BUILD_ROOT PKGDIR0=%{_initrddir} install
+
 
- 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 
 %post host
 /sbin/chkconfig --add rhn-virtualization-host
+%if 0%{?suse_version}
+/sbin/service cron try-restart ||:
+%else
 /sbin/service crond condrestart
+%endif
 
 %preun host
 /sbin/chkconfig --del rhn-virtualization-host
 
 %postun host
+%if 0%{?suse_version}
+/sbin/service cron try-restart ||:
+%else
 /sbin/service crond condrestart
+%endif
 
 %files common
 %defattr(-,root,root,-)
+%dir %{rhn_dir}
+%dir %{rhn_dir}/actions
 %dir %{rhn_dir}/virtualization
 %{rhn_dir}/virtualization/__init__.py
 %{rhn_dir}/virtualization/__init__.pyc
@@ -101,6 +122,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files host
 %defattr(-,root,root,-)
+%dir %{rhn_conf_dir}
 %dir %{rhn_conf_dir}/virt
 %dir %{rhn_conf_dir}/virt/auto
 %{_initrddir}/rhn-virtualization-host
diff --git a/client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE b/client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE
new file mode 100755
index 000..da66d86
--- /dev/null
+++ b/client/tools/rhn-virtualization/scripts/rhn-virtualization-host.SUSE
@@ -0,0 +1,113 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides:   rhn-virtualization-host
+# Required-Start: $network $syslog $remote_fs
+# Required-Stop:  $network $syslog $remote_fs
+# Default-Start:  3 5
+# Default-Stop: 0 1 6
+# Short-Description: Starts up xen domains when the host boots.
+# Description:Starts up xen domains when the host boots.
+### END INIT INFO
+
+# chkconfig: 2345 99 99
+# description: Starts up xen domains when the host boots.
+
+. /etc/rc.status
+
+auto_dir=/etc/sysconfig/rhn/virt/auto
+py_path=/usr/share/rhn:/usr/share/rhn/virtualization
+script_path=/usr/share/rhn/virtualization
+get_config_value=PYTHONPATH=$py_path python $script_path/get_config_value.py
+get_uuid=$get_config_value uuid
+get_name=$get_config_value name
+init_action=PYTHONPATH=$py_path python $script_path/init_action.py
+start_action=$init_action start
+stop_action=$init_action shutdown
+
+if [ -d $auto_dir

[Spacewalk-devel] [PATCH] build spacewalk-koan on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build spacewalk-koan on openSUSE.

0011-build-spacewalk-koan-on-SUSE.patch:
- modify the specfile
- require virtualization packages
  It seems, that code of spacewalk-koan import modules from 
  rhn-virtualization. So I added these requires to the specfile.

  Is there a special reason why it is not there, or simply forgot to add this
  requirement?

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 30054d1b13c57c4693f565d99437c2466838e635 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Tue, 5 Apr 2011 11:00:39 +0200
Subject: [PATCH 11/17] build spacewalk-koan on SUSE

- modify the specfile
- require virtualization packages
---
 client/tools/spacewalk-koan/spacewalk-koan.spec |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/client/tools/spacewalk-koan/spacewalk-koan.spec b/client/tools/spacewalk-koan/spacewalk-koan.spec
index d184849..0124dec 100644
--- a/client/tools/spacewalk-koan/spacewalk-koan.spec
+++ b/client/tools/spacewalk-koan/spacewalk-koan.spec
@@ -12,6 +12,8 @@ BuildArch:  noarch
 BuildRequires:  python
 Requires:   python = 1.5
 Requires:   koan = 1.4.3
+Requires:   rhn-virtualization-common
+Requires:   rhn-virtualization-host
 
 Conflicts: rhn-kickstart
 Conflicts: rhn-kickstart-common
@@ -47,6 +49,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_sbindir}/*
 %{_datadir}/rhn/spacewalkkoan/
 %{_datadir}/rhn/actions/
+%dir %{_datadir}/rhn
+%dir %{_sysconfdir}/sysconfig/rhn
+%dir %{_sysconfdir}/sysconfig/rhn/clientCaps.d
 
 %changelog
 * Wed Feb 02 2011 Tomas Lestach tlest...@redhat.com 0.2.16-1
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] build spacewalk-remote-utils on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is the patch to build spacewalk-remote-utils on openSUSE.

0012-build-spacewalk-remote-utils-on-SUSE.patch
- adding only one little dir to the filelist of the specfile

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From be0b18e181d32a2d20a586f1f07304d73ee3ad01 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Tue, 5 Apr 2011 11:00:52 +0200
Subject: [PATCH 12/17] build spacewalk-remote-utils on SUSE

- modify the specfile
---
 .../spacewalk-remote-utils.spec|1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec b/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
index 1057a89..451038b 100644
--- a/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
+++ b/client/tools/spacewalk-remote-utils/spacewalk-remote-utils.spec
@@ -45,6 +45,7 @@ docbook2man ./spacewalk-create-channel/doc/spacewalk-create-channel.sgml -o ./sp
 
 %files
 %defattr(-,root,root,-)
+%dir %{_datadir}/rhn
 %{_bindir}/spacewalk-create-channel
 #%{python_sitelib}/spacecmd/
 %{_datadir}/rhn/channel-data/
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] adding support zypper in bootstrap script and allow multiple GPG keys

2011-04-08 Thread Michael Calmer
Hi,

here is a patch for the server side. This patch add support for zypper as 
installer to the bootstrap script. 

Additionally it enhances the ORG_GPG_KEY variable to be a comma seperated list 
like the activation keys.

0013-support-zypper-in-bootstrap-script-and-allow-multipl.patch
- add zypper as valid installer in the bootstrap script
- allow to install multiple GPG keys.
  Use comma seperated list in ORG_GPG_KEY
- force installing ORG_CA_CERT if rpm is used

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 1e8596981b5101f7824cfc257f3a611ca96de676 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Tue, 5 Apr 2011 13:25:26 +0200
Subject: [PATCH 13/17] support zypper in bootstrap script and allow multiple GPG keys

- add zypper as valid installer in the bootstrap script
- allow to install multiple GPG keys.
  Use comma seperated list in ORG_GPG_KEY
- force installing ORG_CA_CERT if rpm is used
---
 spacewalk/certs-tools/rhn_bootstrap_strings.py |  116 +---
 1 files changed, 82 insertions(+), 34 deletions(-)

diff --git a/spacewalk/certs-tools/rhn_bootstrap_strings.py b/spacewalk/certs-tools/rhn_bootstrap_strings.py
index af0f4fd..25f71a1 100644
--- a/spacewalk/certs-tools/rhn_bootstrap_strings.py
+++ b/spacewalk/certs-tools/rhn_bootstrap_strings.py
@@ -78,8 +78,8 @@ echo   - edit the values of the VARIABLES below (in this script) as
 echo appropriate:
 echo - ACTIVATION_KEYS needs to reflect the activation key(s) value(s)
 echo   from the website. XKEY or XKEY,YKEY
-echo - ORG_GPG_KEY needs to be set to the name of the corporate public
-echo   GPG key filename (residing in /var/www/html/pub) if appropriate.
+echo - ORG_GPG_KEY needs to be set to the name(s) of the corporate public
+echo   GPG key filename(s) (residing in /var/www/html/pub) if appropriate. XKEY or XKEY,YKEY
 echo
 echo Verify that the script variable settings are correct:
 echo - CLIENT_OVERRIDES should be only set differently if a customized
@@ -131,7 +131,7 @@ PROFILENAME=   # Empty by default to let it be set automatically.
 
 # an idea from Erich Morisse (of Red Hat).
 # use either wget *or* curl
-# Also check to see if the version on the 
+# Also check to see if the version on the
 # machine supports the insecure mode and format
 # command accordingly.
 
@@ -143,7 +143,7 @@ if [ -x /usr/bin/wget ] ; then
 else
 FETCH=/usr/bin/wget -q -r -nd
 fi
-
+
 else
 if [ -x /usr/bin/curl ] ; then
 output=`LANG=en_US /usr/bin/curl -k 21`
@@ -161,9 +161,11 @@ if [ $USING_SSL -eq 0 ] ; then
 HTTPS_PUB_DIRECTORY=${HTTP_PUB_DIRECTORY}
 fi
 
-YUM=up2date
-if [ -x /usr/bin/yum ] ; then
-YUM=yum
+INSTALLER=up2date
+if [ -x /usr/bin/zypper ] ; then
+INSTALLER=zypper
+elif [ -x /usr/bin/yum ] ; then
+INSTALLER=yum
 fi
 
 
@@ -231,19 +233,21 @@ echo   . up2date config file
 
 def getGPGKeyImportSh():
 return \
-if [ ! -z $ORG_GPG_KEY ] ; then 
+if [ ! -z $ORG_GPG_KEY ] ; then
 echo
 echo * importing organizational GPG key
-rm -f ${ORG_GPG_KEY}
-$FETCH ${HTTPS_PUB_DIRECTORY}/${ORG_GPG_KEY}
-# get the major version of up2date
-# this will also work for RHEL 5 and systems where no up2date is installed
-res=$(LC_ALL=C rpm -q --queryformat '%{version}' up2date | sed -e 's/\..*//g')
-if [ x$res == x2 ] ; then
-gpg $(up2date --gpg-flags) --import $ORG_GPG_KEY
-else
-rpm --import $ORG_GPG_KEY
-fi
+for GPG_KEY in $(echo $ORG_GPG_KEY | tr ,  ); do
+	rm -f ${GPG_KEY}
+	$FETCH ${HTTPS_PUB_DIRECTORY}/${GPG_KEY}
+	# get the major version of up2date
+	# this will also work for RHEL 5 and systems where no up2date is installed
+	res=$(LC_ALL=C rpm -q --queryformat '%{version}' up2date | sed -e 's/\..*//g')
+	if [ x$res == x2 ] ; then
+	gpg $(up2date --gpg-flags) --import $GPG_KEY
+	else
+	rpm --import $GPG_KEY
+	fi
+done
 fi
 
 
@@ -255,11 +259,23 @@ echo
 echo * attempting to install corporate public CA cert
 if [ $USING_SSL -eq 1 ] ; then
 if [ $ORG_CA_CERT_IS_RPM_YN -eq 1 ] ; then
-rpm -Uvh ${HTTP_PUB_DIRECTORY}/${ORG_CA_CERT}
+rpm -Uvh --force --replacefiles --replacepkgs ${HTTP_PUB_DIRECTORY}/${ORG_CA_CERT}
 else
 rm -f ${ORG_CA_CERT}
 $FETCH ${HTTP_PUB_DIRECTORY}/${ORG_CA_CERT}
 mv ${ORG_CA_CERT} /usr/share/rhn/
+
+fi
+if [ $INSTALLER == zypper ] ; then
+	if [  $ORG_CA_CERT_IS_RPM_YN -eq 1 ] ; then
+	  # get name from config
+	  ORG_CA_CERT=$(basename $(sed -n 's/^sslCACert *= *//p' /etc/sysconfig/rhn/up2date))
+	fi
+	test -e /etc/ssl/certs/${ORG_CA_CERT}.pem

[Spacewalk-devel] [PATCH] build rhnmd on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

here is a patch to build rhnmd on openSUSE.

0014-build-rhnmd-on-SUSE.patch
- modify the specfile
- add init script for openSUSE

For SUSE I have removed the ssh key generation from the %post section.
I added the generation into the SUSE init script. 
The reason for this is, that if you do it in %post and use this RPM in an 
appliance, you have the same ssh key on all copies of your appliance.

Maybe you are interrested to do this also for RedHat / Fedora. 

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 4122bb4df08db847813f13fc53f37ef76568f749 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Wed, 6 Apr 2011 12:24:08 +0200
Subject: [PATCH 14/17] build rhnmd on SUSE

- modify the specfile
- add init script for SUSE
---
 monitoring/rhnmd/rhnmd.init.SUSE |  107 ++
 monitoring/rhnmd/rhnmd.spec  |   21 +++-
 2 files changed, 127 insertions(+), 1 deletions(-)
 create mode 100644 monitoring/rhnmd/rhnmd.init.SUSE

diff --git a/monitoring/rhnmd/rhnmd.init.SUSE b/monitoring/rhnmd/rhnmd.init.SUSE
new file mode 100644
index 000..a77edff
--- /dev/null
+++ b/monitoring/rhnmd/rhnmd.init.SUSE
@@ -0,0 +1,107 @@
+#!/bin/bash
+#
+# Init file for rhnmd daemon
+#
+# chkconfig: 2345 99 1
+# description: rhnmd server daemon
+#
+# processname: rhnmd
+
+### BEGIN INIT INFO
+# Provides: rhnmd
+# Required-Start: $local_fs $network $remote_fs
+# Required-Stop: $local_fs $network $remote_fs
+# Default-Start: 2 3 5
+# Default-Stop: 0 1 6
+# Short-Description: rhnmd server daemon
+# Description: Provides wrapper around sshd
+#   so NOCpulse monitoring can connect to your machine
+#   and run probes, which requires local account.
+### END INIT INFO
+
+# source function library
+. /etc/rc.status
+
+prog=rhnmd
+
+# Some functions to make the below more readable
+SU=/bin/su -s /bin/bash - nocpulse -c
+SSHD=/usr/sbin/rhnmd
+SSHD_PIDFILE=/var/run/rhnmd.pid
+
+do_restart_sanity_check()
+{
+	$SU $SSHD -t -f /etc/nocpulse/rhnmd_config
+	RETVAL=$?
+	if [ ! $RETVAL = 0 ]; then
+		rc_failed
+		echo Configuration file or keys are invalid
+	fi
+}
+
+start()
+{
+	echo -n $Starting $prog:
+	IDENTITY=/var/lib/nocpulse/.ssh/nocpulse-identity
+	if [ ! -f $IDENTITY ]
+	then
+		/bin/su -s /bin/bash -c /usr/bin/ssh-keygen -q -t dsa -N '' -f $IDENTITY - nocpulse
+		if [ ! -e /var/lib/nocpulse/.bashrc ]; then
+			echo 'LANG=C'  /var/lib/nocpulse/.bashrc
+		fi
+	fi
+	startproc -p $SSHD_PIDFILE $SSHD -f /etc/nocpulse/rhnmd_config -o PidFile=$SSHD_PIDFILE
+	rc_status
+	touch /var/lock/subsys/rhnmd
+	rc_status -v
+}
+
+stop()
+{
+	echo -n $Stopping $prog:
+	rm -f /var/lock/subsys/rhnmd
+	killproc -p $SSHD_PIDFILE -TERM $SSHD
+rc_status -v
+}
+
+reload()
+{
+	echo -n $Reloading $prog:
+	killproc -p $SSHD_PIDFILE -HUP $SSHD
+	rc_status -v
+}
+
+case $1 in
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	restart)
+		stop
+		start
+		;;
+	reload)
+		reload
+		;;
+	condrestart|try-restart)
+		if [ -f /var/lock/subsys/rhnmd ] ; then
+			do_restart_sanity_check
+			if [ $RETVAL = 0 ] ; then
+stop
+# avoid race
+sleep 3
+start
+			fi
+		fi
+		;;
+	status)
+	echo -n Checking for service rhnmd: 
+		checkproc -p $SSHD_PIDFILE $SSHD
+		rc_status -v
+		;;
+	*)
+		echo $Usage: $0 {start|stop|restart|reload|condrestart|status}
+esac
+rc_exit
diff --git a/monitoring/rhnmd/rhnmd.spec b/monitoring/rhnmd/rhnmd.spec
index 6779bb5..66fcc1f 100644
--- a/monitoring/rhnmd/rhnmd.spec
+++ b/monitoring/rhnmd/rhnmd.spec
@@ -14,7 +14,12 @@ License:GPLv2
 BuildArch:  noarch
 Group:  System Environment/Daemons
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires:   openssh-server openssh
+Requires:   openssh
+%if 0%{?suse_version}
+BuildRequires:  openssh sysconfig
+%else
+Requires:   openssh-server
+%endif
 BuildRequires:  pam-devel
 Obsoletes:  rhnmd.i386  5.3.0-5
 Obsoletes:  rhnmd.x86_64  5.3.0-5
@@ -42,7 +47,11 @@ mkdir -p $RPM_BUILD_ROOT%{_var}/lib/%{np_name}/.ssh
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
 mkdir -p $RPM_BUILD_ROOT%{_libdir}
 ln -sf sshd $RPM_BUILD_ROOT%{_usr}/sbin/rhnmd
+%if 0%{?suse_version}
+install -pm 0755 rhnmd.init.SUSE $RPM_BUILD_ROOT%{_initddir}/rhnmd
+%else
 install -pm 0755 rhnmd-init $RPM_BUILD_ROOT%{_initddir}/rhnmd
+%endif
 install -pm 0644 rhnmd_config $RPM_BUILD_ROOT%{_sysconfdir}/%{np_name}/rhnmd_config
 install -pm 0600 authorized_keys $RPM_BUILD_ROOT%{_var}/lib/%{np_name}/.ssh/authorized_keys
 install -pm 0644 rhnmd-pam_config $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/rhnmd
@@ -50,9 +59,15 @@ install -pm 0644

[Spacewalk-devel] [PATCH] small fix for spacewalk-backend

2011-04-08 Thread Michael Calmer
Hi,

and now the last one :-)

I found a small issue in spacewalk-backend, where the locale files are 
installed in duplicate buildroot environment.

In backend/po/Makefile, localedir is defined as $(PREFIX)/usr/share/locale
and in the install section files are installed to $(PREFIX)/$(localedir) .

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 20cb8563e6e1359aae1b97109cdb8bb51f418b74 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Fri, 8 Apr 2011 10:33:32 +0200
Subject: [PATCH 15/17] remove duplicate PREFIX for locale installation

---
 backend/po/Makefile |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/backend/po/Makefile b/backend/po/Makefile
index 728e908..f5c3c82 100644
--- a/backend/po/Makefile
+++ b/backend/po/Makefile
@@ -4,7 +4,7 @@
 
 TOP	= ..
 SUBDIR	= locale
-localedir = $(PREFIX)/usr/share/locale
+localedir = /usr/share/locale
 
 include $(TOP)/Makefile.defs
 
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] build rhn-client-tools on openSUSE

2011-04-08 Thread Michael Calmer
Hi,

Am Freitag, 8. April 2011, 14:49:30 schrieb Michael Calmer:
 Hi,
 
 
 0002-enhance-getOSVersionAndRelease-to-find-SUSE-distribu.patch:
 Add code to make _getOSVerionAndRelease work on SUSE

This patch has a little typo. I have attached a fixed version.
Sorry :-)

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 4ea53dfc537e92fd870cd414fc901edb83f7d288 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 4 Apr 2011 11:12:04 +0200
Subject: [PATCH 02/17] enhance getOSVersionAndRelease to find SUSE distributions

---
 .../src/up2date_client/up2dateUtils.py |   16 +++-
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py b/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py
index fc33ad1..f7d064f 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/up2dateUtils.py
@@ -32,11 +32,17 @@ else:
 osVersionRelease = (h['name'], h['version'], h['release'])
 return osVersionRelease
 else:
-raise up2dateErrors.RpmError(
-Could not determine what version of Red Hat Linux you \
-are running.\nIf you get this error, try running \n\n\
-\t\trpm --rebuilddb\n\n)
-
+for h in ts.dbMatch('Providename', distribution-release):
+osVersionRelease = (h['name'], h['version'], h['release'])
+# zypper requires a exclusive lock on the rpmdb. So we need
+# to close it here.
+ts.ts.closeDB()
+return osVersionRelease
+else:
+raise up2dateErrors.RpmError(
+Could not determine what version of Red Hat Linux you \
+are running.\nIf you get this error, try running \n\n\
+\t\trpm --rebuilddb\n\n)
 
 def getVersion():
 '''
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] rhn-custom-info

2011-04-07 Thread Michael Calmer
Hi,

during some tests of the master branch I realized some issues with rhn-custom-
info. It seems that some reorganization of the code introduced some bugs in 
this package.

I have created a patch which is attached.

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From c8c5bd99efdd0188464b1d9de2fd9f8ba6d6331a Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Thu, 7 Apr 2011 12:00:52 +0200
Subject: [PATCH] fix rhn-custom-info

- getServerURL() return now an array. Use the first value
- sslCACert is now from type unicode and not string
- initUp2dateConfig is in module config
---
 client/tools/rhncustominfo/rhn-custom-info.py |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/client/tools/rhncustominfo/rhn-custom-info.py b/client/tools/rhncustominfo/rhn-custom-info.py
index 7f886ed..73d91e9 100755
--- a/client/tools/rhncustominfo/rhn-custom-info.py
+++ b/client/tools/rhncustominfo/rhn-custom-info.py
@@ -32,7 +32,7 @@ from up2date_client import up2dateAuth
 
 def create_server_obj(server_url):
 
-cfg = initUp2dateConfig()
+cfg = config.initUp2dateConfig()
 
 enable_proxy = cfg['enableProxy']
 proxy_host = None
@@ -48,7 +48,7 @@ def create_server_obj(server_url):

 ca = cfg['sslCACert']
 
-if type(ca) == type():
+if isinstance(ca, str) or isinstance(ca, unicode):
 ca = [ca]
  
 ca_certs = ca or [/usr/share/rhn/RHNS-CA-CERT]
@@ -184,7 +184,7 @@ def main():
 if options.url:
 url = options.url
 else:
-url = munge_server_url(config.getServerlURL())
+url = munge_server_url(config.getServerlURL()[0])
 
 s = create_server_obj(url)
 
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] Has signed Metadata

2011-03-21 Thread Michael Calmer
Hi,

Am Montag, 21. März 2011, 15:28:49 schrieb Michael Mraka:
 Michael Mraka wrote:
 % Michael Calmer wrote:
 % % Hello,
 % % 
 % Hi Michael,
 % 
 % your second patch failed to apply on today's master HEAD (namely
 % b9d72a78d8084df93c90cd365ca24b776306eb15). 
 % 
 % I tried to apply it on older base - from Mon 7 Mar 2011 when you sent
 % the patches - to get rid of changes we made later. Unfortunately
 % it failed to apply even there.
 % Could you please rebase your patch to the lastest spacewalk master?

yes, I need to re-do the patch. 
 
 % 
 %   $ git am /tmp/0002-implement-metadata-signature-checking-for-
repositori.patch 
 %   Applying: implement metadata signature checking for repositories
 %   spacewalk.git/.git/rebase-apply/patch:68: trailing whitespace.
 %   
 %   spacewalk.git/.git/rebase-apply/patch:200: trailing whitespace.
 %
 %   error: patch failed: backend/satellite_tools/repo_plugins/yum_src.py:16
 
 Michael,
 
 I'm trying apply 0002 patch manually and the error is
 
   patching file backend/satellite_tools/repo_plugins/yum_src.py
   Hunk #1 FAILED at 16.
   Hunk #2 succeeded at 32 (offset -3 lines).
   Hunk #3 succeeded at 64 (offset -3 lines).
   Hunk #4 FAILED at 116.
 
 In the hunk #1 there is 
 
 % diff --git a/backend/satellite_tools/repo_plugins/yum_src.py 
b/backend/satellite_tools/repo_plugins/yum_src.py
 % index 782d49d..3b52d0a 100644
 % --- a/backend/satellite_tools/repo_plugins/yum_src.py
 % +++ b/backend/satellite_tools/repo_plugins/yum_src.py
 % @@ -16,10 +16,18 @@
 %  import yum
 %  import shutil
 %  import sys
 % +import os
 %  from yum import config

It seems this was there in older spacewalk versions and removed some time ago, 
but it was still in our git and by accident re-added in the updateinfo to 
Errata patch set.

 %  from yum.update_md import UpdateMetadata
 % -from spacewalk.satellite_tools.reposync import ContentPackage
 ...
 
 but there aren't lines 'from yum import config' and 'from yum.update_md
 import UpdateMetadata' so you probably missed some older commit which is
 required by your patch.
 
 Similary hunk #4 starts with
 
   @@ -106,3 +124,142 @@ class ContentSource:
  um = UpdateMetadata()
  um.add(self.repo, all=True)
  return um.notices
 
 which code is missing in spacewalk master.

yes, all this is part of the updateinfo to Errata patch.


I would suggest, that we go step by step. So let's wait until weak deps and 
updateinfo to errata is applied. After this I will submit a new patch for 
this feature based on the new master.

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Re: [Spacewalk-devel] [PATCH] updateinfo to Errata import in?spacewalk-repo-sync

2011-03-11 Thread Michael Calmer
Hi,

Am Freitag, 11. März 2011, 11:23:09 schrieb Jan Pazdziora:
 On Fri, Mar 11, 2011 at 10:31:45AM +0100, Michael Calmer wrote:
   
   is at fault -- at least in that Fedora 7 updateinfo, the version
   is not integer. When I've changed the line to
   
 e['advisory_rel'] = 1
   
   things went much better.
  
  Yes, this is the version appended to advisory_name. Here is an example
  from openSUSE which shows the unique problem
  
  updates
  !--PATCHINFO id=898568de8313f62fc290e303946cfe11!--
  update status=stable from=maint-co...@suse.de type=recommended 
  version=1596
idflash-player/id
issued date=1256155647/
  [...]
  update status=stable from=maint-co...@suse.de type=security 
  version=1707
idflash-player/id
issued date=1260492724/
  
  Same id used but with a different version. I think we need to find a way
  to deal with all these differences in how updateinfo is used.
 
 Right. I've checked
 
   
http://download.englab.brq.redhat.com/pub/fedora/linux/updates/14/i386/repodata/updateinfo.xml.gz
 
 and it still has version=1.4 there, so it looks like Fedora uses
 that attribute to mean the version of the data structure (it's 1.4
 both on Fedora 7 and Fedora 14), not version of the errata.
 
 Can you come up with some proposal? From top of my head, we could add
 a type of updatesinfo to the repository definition in the database
 and use that, or use some heuristics, either checking that the id
 does not end with /-\d+-\d+$/ or checking something else specific to
 Fedora / *SuSE.

yes. I will try to look into it next week.
 
  About the channel label added to the advisory_name.
  
  I think the correct way would be to search in DB if the errata already
  exist.
  If so, create the errata object from the DB and add the new packages and 
  channels to it.
  Than update the errata in the database.
 
 Exactly.

Fine.
 
  Doing this, we do not need to append the channel label to advisory_name.
  
  Is there already a method to create an Erratum object from the database?
 
 There has to be, as satellite-sync does exactly that. Unfortunately,
 I won't be able to dig into it for the next week as I will be away
 -- if you could investigate, that would be great.

I think I will find this. Thanks for the hint.

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] [PATCH] updateinfo to Errata import in spacewalk-repo-sync

2011-03-10 Thread Michael Calmer
Hi,

Am Mittwoch, 9. März 2011, 11:29:45 schrieb Jan Pazdziora:
 On Mon, Mar 07, 2011 at 02:28:48PM +0100, Michael Calmer wrote:
[...] 
 when running git am, I get the following whitespace-related warnings.
 Could you please polish the patch to get rid of them?

Sure, I will work on all the issues as soon as time permits. May take some 
days. 

-- 
Regards,

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


Re: [Spacewalk-devel] [PATCH] updateinfo to Errata import in spacewalk-repo-sync

2011-03-08 Thread Michael Calmer
Hi,

Am Montag, 7. März 2011, 15:49:59 schrieb Miroslav Suchý:
 On 03/07/2011 02:28 PM, Michael Calmer wrote:
  Hello,
 
[...]
 
 Regarding patch 0001-implement-updateinfo-Errata-import-5.patch...
 It seems to me that it is merge of 4 smaller commits and therefore the
 commit description is quite misleading...
 I would expectd something like:
 Decide if package is errata based on updateinfo

Well, this was the initial patch for this feature. So I think 
implement updateinfo to Errata import is a good headline.
The 2 additional patches merged into this first commit were smaller bugfixes 
for the initial patch.
 
 and something more how the detection works and which all information you
 extract from updateinfo.

* fix errata override bug. Create a unique advisory_name
This was about the id element in the updateinfo which is not unique.
To get it unique we append notice['version'] to it. The next hit was,
that patches may be created for mulitarch repositories, but in spacewalk we 
have single arch channels. This can lead into duplicate updates where only the 
package list differ because of the architectures. So we also append 
self.channel['arch'] to advisory and advisory_name

* we need to search for the package in the correct channel.

It may happen, that the same nevra exists multiple times in rhnPackage.
The only difference is the checksum. They are assigned to different
channels. So we need to take care during errata import to get the
right package added to the errata.

This was a fix for the big select statement which searches for the checksum of 
a package. 
The updateinfo only contains the package nevra and and errata wants the 
package checksum. So we need to search for the package in the DB. But if we do 
not include the channel as search criteria, we may find the wrong package 
which exists in a different channel.


The complete patchset uses the following updateinfo elements:

id: used in advisory and advisory_name
version: used in advisory and advisory_name and set to advisory_rel
type: is translated into spacewalk errata types and put into advisory_type
title: set to synopsis
release: set to product
issued: converted to db date and put into issue_date
references: bugzilla and CVE numbers are converted to the errata tables
description: set to description
The package list is evaluated and the packages are linked to the errata
reboot_suggested: this flag is added as keyword to errata
restart_suggested: this flag is added as keyword to errata
from: we enhanced the errata table and add the column errata_from to have 
  a place where the author/vendor could be stored.


The errata fields topic and solution are set to  (empty) because there 
is no equivalent in updateinfo (yet).

-- 
MFG

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] [PATCH] Has signed Metadata

2011-03-07 Thread Michael Calmer
Hello,

the attached patch set implements checking of signed metadata before mirroring 
with spacewalk-repo-sync.
This patch adds a checkbox in Manage Repositories. If this checkbox is 
checked, spacewalk-repo-sync expects, that the repo metadata are signed and 
try to verify the signature with an installed gpg key. If a matching gpg key 
is not found and the new commandile parameter --non-interactive is given, 
spacewalk-repo-sync abort with an error.
if --non-interactive is not given, spacewalk-repo-sync try to download the key 
file from the server, display the values and ask the user to accept the key.
If the user agree, the key is installed and the signature will be verified.

-- 
MFG

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
From 79e5e782c657e40f6a5fd18f4b16bd36ceb14855 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Sun, 6 Mar 2011 14:12:34 +0100
Subject: [PATCH 1/2] add column metadata_signed to rhnContentSource table

---
 .../spacewalk/common/tables/rhnContentSource.sql   |4 
 .../019-add-metadata_signed.sql|7 +++
 2 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 schema/spacewalk/upgrade/spacewalk-schema-1.3-to-spacewalk-schema-1.4/019-add-metadata_signed.sql

diff --git a/schema/spacewalk/common/tables/rhnContentSource.sql b/schema/spacewalk/common/tables/rhnContentSource.sql
index dc93a27..df768ee 100644
--- a/schema/spacewalk/common/tables/rhnContentSource.sql
+++ b/schema/spacewalk/common/tables/rhnContentSource.sql
@@ -29,6 +29,10 @@ rhnContentSource
 references rhnContentSourceType(id),
 source_url  varchar2(512) NOT NULL,
 label   varchar2(64) NOT NULL,
+metadata_signed CHAR(1)
+DEFAULT ('Y') NOT NULL
+CONSTRAINT rhn_cs_ms_ck
+CHECK (metadata_signed in ( 'Y' , 'N' )), 
 created date default(sysdate) NOT NULL,
 modifieddate default(sysdate) NOT NULL
 )
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.3-to-spacewalk-schema-1.4/019-add-metadata_signed.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.3-to-spacewalk-schema-1.4/019-add-metadata_signed.sql
new file mode 100644
index 000..ae0f1f0
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.3-to-spacewalk-schema-1.4/019-add-metadata_signed.sql
@@ -0,0 +1,7 @@
+
+alter table rhnContentSource
+add metadata_signed char(1) default('Y')
+constraint rhn_cs_ms_nn not null
+constraint rhn_cs_ms_ck
+check (metadata_signed in ('Y','N'));
+
-- 
1.7.1

From 4fa0bd3b2561ded494877bcbe668dd6dbfb7a7c1 Mon Sep 17 00:00:00 2001
From: Michael Calmer m...@suse.de
Date: Mon, 25 Oct 2010 11:20:29 +0100
Subject: [PATCH 2/2] implement metadata signature checking for repositories

expect not signed metadata with spacewalk-repo-sync if url is given on the commandline

fix changing hasSignedMetadata

style fixes
---
 backend/satellite_tools/repo_plugins/yum_src.py|  165 +++-
 backend/satellite_tools/reposync.py|   44 +-
 .../rhn/domain/channel/ContentSource.hbm.xml   |1 +
 .../redhat/rhn/domain/channel/ContentSource.java   |   17 ++
 .../channel/manage/repo/RepoDetailsAction.java |   20 +++
 .../channel/manage/repo/validation/repoForm.xsd|2 +-
 .../frontend/strings/jsp/StringResource_en_US.xml  |3 +
 .../rhn/manager/channel/repo/BaseRepoCommand.java  |   21 +++
 .../redhat/rhn/taskomatic/task/RepoSyncTask.java   |1 +
 .../pages/channel/manage/repo/repodetails.jsp  |8 +
 java/code/webapp/WEB-INF/struts-config.xml |1 +
 11 files changed, 271 insertions(+), 12 deletions(-)

diff --git a/backend/satellite_tools/repo_plugins/yum_src.py b/backend/satellite_tools/repo_plugins/yum_src.py
index 782d49d..3b52d0a 100644
--- a/backend/satellite_tools/repo_plugins/yum_src.py
+++ b/backend/satellite_tools/repo_plugins/yum_src.py
@@ -16,10 +16,18 @@
 import yum
 import shutil
 import sys
+import os
 from yum import config
 from yum.update_md import UpdateMetadata
-from spacewalk.satellite_tools.reposync import ContentPackage
 from spacewalk.common import CFG, initCFG
+from spacewalk.satellite_tools.reposync import ContentPackage, ChannelException
+from urlgrabber.grabber import URLGrabber
+import urlgrabber
+from yum import misc, Errors
+from urlgrabber.grabber import default_grabber
+from yum.i18n import to_unicode, to_utf8
+from rpmUtils.transaction import initReadOnlyTransaction
+import subprocess
 
 class

Re: [Spacewalk-devel] [PATCH] updateinfo to Errata import in spacewalk-repo-sync

2011-03-07 Thread Michael Calmer
Hi,

Am Montag, 7. März 2011, 15:05:36 schrieb Miroslav Suchý:
 On 03/07/2011 02:28 PM, Michael Calmer wrote:
  Hello,
  
  the attached patch set implements updateinfo to errata import in
  spacewalk-repo-sync.
  This patch also requires two small changes to yum. Patches are also
  attached.
  
  This patch include also two enhancements. It adds errata_from to store the
  from attribute of the updateinfo into the database.
  Seconds it adds a URL attribute to bugs which make it possible to show
  links in the web page also for 3rd party bugs linked to other bugzilla
  instances than bugzilla.redhat.com.
 
 Unfortunately Spacewalk is not upstream for yum. We are just upstream
 for yum-rhn-plugin.
 But if I'm reading those patches correctly it should not have affect all
 other patches, right?

If you do not apply patch 0008, you may get only the newest patch for a 
package. This also depends on how the id in updateinfo is created. 
SUSE uses often the same id for the same package (e.g. kernel patch) and 
increase the version number. The idea of how id should be used seems to be 
different :-)
yum create a hash using id as a key. This has the consequence, that only the 
last patch (normally highest version number) is part of the returned notices.
Older are ignored.

The restart_suggested may need small changes to patch 0001. I am not a 
python guru, but I think if you call

 if notice['restart_suggested']:

and the key restart_suggested does not exist, you will get a KeyError.
So maybe something like 

 if restart_suggested in notice and notice['restart_suggested']:

would workaround this.
 
 -- 
 Miroslav Suchy
 Red Hat Satellite Engineering
 
 ___
 Spacewalk-devel mailing list
 Spacewalk-devel@redhat.com
 https://www.redhat.com/mailman/listinfo/spacewalk-devel
 


-- 
MFG

Michael Calmer

--
Michael Calmer
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
T: +49 (0) 911 74053 0
F: +49 (0) 911 74053575  - e-mail: michael.cal...@suse.com
--
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)


signature.asc
Description: This is a digitally signed message part.
___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel