Re: [Spacewalk-devel] Suggestions for sysdate, for PostgreSQL?

2010-07-21 Thread Jan Pazdziora
On Wed, Jul 21, 2010 at 06:21:04PM -0400, Tom Lane wrote:
> Jan Pazdziora  writes:
> > what are our possibilities for handling sysdate in PostgreSQL.
> 
> Isn't s/sysdate/current_timestamp/g a good solution?  That's standards
> compliant, unlike sysdate.

I wouldn't dare to do that en masse. It's a different type --
timestamp instead of date, so it has different precision, and I'm not
sure if the arithmetic is exactly the same.

But you are right, we could just change that one-by-one, verifying any
side effect of the change, as we keep hitting the sysdate errors.

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

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


Re: [Spacewalk-devel] What do I do with all those potential bugzillas ?

2010-07-21 Thread Jan Pazdziora
On Wed, Jul 21, 2010 at 11:17:57PM +0200, Jerome Fenal wrote:
> 
> still ongoing on my Perl OO API for Spacewalk/Satellite, I have
> collected quite a few glitches during development (unit test helps
> here).
> 
> As the number is growing, I'm getting a bit concerned of not taking care
> of those... :)
> 
> You can find those here :
> http://github.com/jfenal/RHNC/blob/master/Bugzillas.txt
> 
> Do you want me to open a bugzilla for each of those, or may I

Yes, one bugzilla per issue, please.

It is easier for people to pick one small thing and create and
submit patch than to work with mega-bugzilla that lists multiple
issues.

Thank you,

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

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


Re: [Spacewalk-devel] Migrating systems

2010-07-21 Thread Colin Coe
On Thu, Jul 22, 2010 at 11:42 AM, Colin Coe  wrote:
> Yay!  It works, systems can be migrated via the webUI.
>
> The only problem is that all entitlements get stripped (management,
> provisioning, etc) and software channel memberships are lost also.
> Given I'm doing the migration by calling
> "MigrationManager.migrateServers(user, toOrg, serverList);" I'm
> thinking that the problem is in the MigrationManager code.  Does that
> sound right or is it more likely to be my code?
>
> Thanks
>
> CC
>

I've done some hacking in
'code/src/com/redhat/rhn/manager/org/MigrationManager.java' and added
functionality to preserve and then restore:
- base software channel
- child software channels
- entitlements

Is this OK to apply to the git tree?  I ask as I'm wondering if this
was considered but rejected for business or logic reasons.

Thanks

CC

-- 
RHCE#805007969328369

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


Re: [Spacewalk-devel] Migrating systems

2010-07-21 Thread Colin Coe
Yay!  It works, systems can be migrated via the webUI.

The only problem is that all entitlements get stripped (management,
provisioning, etc) and software channel memberships are lost also.
Given I'm doing the migration by calling
"MigrationManager.migrateServers(user, toOrg, serverList);" I'm
thinking that the problem is in the MigrationManager code.  Does that
sound right or is it more likely to be my code?

Thanks

CC

On Thu, Jul 22, 2010 at 8:41 AM, Colin Coe  wrote:
> On Tue, Jul 20, 2010 at 11:04 PM, Cliff Perry  wrote:
>> Colin Coe wrote:
>>>
>>> Hi all
>>>
>>> I'm nearly finished a patch that adds a 'Migrate' tab to
>>> 'https://172.22.102.223/rhn/systems/details/Overview.do?sid=110001'
>>>
>>> The problem I'm having is that when click on the 'Migrate System'
>>> submit button (see sw2.png) I get an ISE and a large trace back.  One
>>> of the prominent lines in the trace back is 'Could not find server
>>> 110001 for user 1' however when I run the SQL below it works fine.
>>>
>>> ---
>>> SQL> SELECT 1 FROM rhnUserServerPerms USP WHERE USP.user_id = 1 and
>>> USP.server_id = 110001;
>>>
>>>  1
>>> --
>>>  1
>>> ---
>>>
>>> The trace back is attached, any pointers on how to resolve the ISE
>>> would be great.
>>>
>>> Thanks
>>>
>>> CC
>>>
>>>
>>>
>>> 
>>>
>>>
>>> 
>>>
>>>
>>> 
>>>
>>> ___
>>> Spacewalk-devel mailing list
>>> Spacewalk-devel@redhat.com
>>> https://www.redhat.com/mailman/listinfo/spacewalk-devel
>>
>> I'm not answering your question about the traceback, instead, some
>> warnings/notes.
>>
>> We did not choose to expose System Migration in the UI, due to the level of
>> access required to know about different Orgs.
>>
>> Use case being:
>> I'm a large IT org, I do not want my WebApp devel team in Org Foo to
>> see/know anything about my production systems, or the existence of that org,
>> Org SuperITOrg.
>>
>> As such, any WebUI will need the same rules of permissions as API script,
>> that the Org Trusts are setup (so drop down only shows Orgs with trust,
>> where API would work), then that the migrate tab is not displayed for normal
>> users, your an OrgAdmin (think that is what is needed for API, or SatAdmin).
>>
>> In short, be careful about who can use it, if you want it accepted into
>> Satellite :)
>>
>> Cliff
>>
>
> Hi Cliff
>
> I've now put in an ACL so only Sat and Org admins see the migrate tab.
>
> CC
>
> --
> RHCE#805007969328369
>



-- 
RHCE#805007969328369

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


Re: [Spacewalk-devel] Migrating systems

2010-07-21 Thread Colin Coe
On Tue, Jul 20, 2010 at 11:04 PM, Cliff Perry  wrote:
> Colin Coe wrote:
>>
>> Hi all
>>
>> I'm nearly finished a patch that adds a 'Migrate' tab to
>> 'https://172.22.102.223/rhn/systems/details/Overview.do?sid=110001'
>>
>> The problem I'm having is that when click on the 'Migrate System'
>> submit button (see sw2.png) I get an ISE and a large trace back.  One
>> of the prominent lines in the trace back is 'Could not find server
>> 110001 for user 1' however when I run the SQL below it works fine.
>>
>> ---
>> SQL> SELECT 1 FROM rhnUserServerPerms USP WHERE USP.user_id = 1 and
>> USP.server_id = 110001;
>>
>>  1
>> --
>>  1
>> ---
>>
>> The trace back is attached, any pointers on how to resolve the ISE
>> would be great.
>>
>> Thanks
>>
>> CC
>>
>>
>>
>> 
>>
>>
>> 
>>
>>
>> 
>>
>> ___
>> Spacewalk-devel mailing list
>> Spacewalk-devel@redhat.com
>> https://www.redhat.com/mailman/listinfo/spacewalk-devel
>
> I'm not answering your question about the traceback, instead, some
> warnings/notes.
>
> We did not choose to expose System Migration in the UI, due to the level of
> access required to know about different Orgs.
>
> Use case being:
> I'm a large IT org, I do not want my WebApp devel team in Org Foo to
> see/know anything about my production systems, or the existence of that org,
> Org SuperITOrg.
>
> As such, any WebUI will need the same rules of permissions as API script,
> that the Org Trusts are setup (so drop down only shows Orgs with trust,
> where API would work), then that the migrate tab is not displayed for normal
> users, your an OrgAdmin (think that is what is needed for API, or SatAdmin).
>
> In short, be careful about who can use it, if you want it accepted into
> Satellite :)
>
> Cliff
>

Hi Cliff

I've now put in an ACL so only Sat and Org admins see the migrate tab.

CC

-- 
RHCE#805007969328369

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


Re: [Spacewalk-devel] Migrating systems

2010-07-21 Thread Colin Coe
On Wed, Jul 21, 2010 at 3:42 AM, Justin Sherrill  wrote:
> On 7/19/10 8:50 PM, Colin Coe wrote:
>
> Hi all
>
> I'm nearly finished a patch that adds a 'Migrate' tab to
> 'https://172.22.102.223/rhn/systems/details/Overview.do?sid=110001'
>
> The problem I'm having is that when click on the 'Migrate System'
> submit button (see sw2.png) I get an ISE and a large trace back.  One
> of the prominent lines in the trace back is 'Could not find server
> 110001 for user 1' however when I run the SQL below it works fine.
>
> ---
> SQL> SELECT 1 FROM rhnUserServerPerms USP WHERE USP.user_id = 1 and
> USP.server_id = 110001;
>
>   1
> --
>   1
> ---
>
> The trace back is attached, any pointers on how to resolve the ISE
> would be great.
>
> Thanks
>
> CC
>
>
>
> ___
> Spacewalk-devel mailing list
> Spacewalk-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-devel
>
> Hey Colin,
>
> So I'm wondering if you are getting that error after the migration has taken
> place?    As in you click migrate, the system gets migrated correctly to the
> 2nd org, but then the page tries to come back to that system (which no
> longer exists in the org).   Once that fails the entire transaction would
> get rolled back causing that query to run correctly again when you run it
> manually.
>
> I would think you would want to redirect to the normal system list page
> after the migration, are you doing that?
>
> -Justin
>

Hi Justin

I've made this change locally:
---
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -3037,7 +3037,7 @@
  
  
  
---
in an attempt to resolve the problem you described but unfortunately I
still get exactly the same trace back.

I'll keep hacking at it, but any other ideas or suggestions would be great.

Thanks

CC

-- 
RHCE#805007969328369

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


Re: [Spacewalk-devel] Suggestions for sysdate, for PostgreSQL?

2010-07-21 Thread Tom Lane
Jan Pazdziora  writes:
> what are our possibilities for handling sysdate in PostgreSQL.

Isn't s/sysdate/current_timestamp/g a good solution?  That's standards
compliant, unlike sysdate.

regards, tom lane

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


Re: [Spacewalk-devel] spacewalk-java on Fedora 13

2010-07-21 Thread Colin Coe
Sorry, still looks borken.

---
[c...@sw-devel java]$ git pull
Enter passphrase for key '/home/coec/.ssh/id_rsa':
remote: Counting objects: 165, done.
remote: Compressing objects: 100% (96/96), done.
remote: Total 97 (delta 83), reused 0 (delta 0)
Unpacking objects: 100% (97/97), done.
>From ssh://git.fedorahosted.org/git/spacewalk
   e177a9c..e928ed3  master -> origin/master
Updating e177a9c..e928ed3
Fast forward
 client/rhel/rhn-client-tools/man/en/rhn-channel.8  |1 +
...snip...
 .../src/up2date_client/rhnreg_constants.py |6 +-
 java/buildconf/build-props.xml |2 +-
 71 files changed, 50619 insertions(+), 41439 deletions(-)
 create mode 100644 client/rhel/rhn-client-tools/man/en/rhn-channel.8
[c...@sw-devel java]$ ant all
Buildfile: build.xml
  [taskdef] Could not load definitions from resource
net/sf/antcontrib/antcontrib.properties. It could not be found.

BUILD FAILED
/home/coec/git/spacewalk/java/build.xml:8: The following error
occurred while executing this line:
/home/coec/git/spacewalk/java/buildconf/build-props.xml:84: Could not
create task or type of type: if.
...snip...
---

CC

On Wed, Jul 21, 2010 at 9:47 PM, Justin Sherrill  wrote:
> On 7/21/10 8:47 AM, Colin Coe wrote:
>>
>> HI Justin
>>
>> I'm building another spacewalk dev system (32bit RHEL5 fully patched)
>> and when I run the 'ant all' in the dev setup instructions
>> (https://fedorahosted.org/spacewalk/wiki/DevelopmentWorkstationSetup)
>> I'm getting this error:
>> ---
>> Buildfile: build.xml
>>   [taskdef] Could not load definitions from resource
>> net/sf/antcontrib/antcontrib.properties. It could not be found.
>>
>> BUILD FAILED
>> /home/coec/git/spacewalk/java/build.xml:8: The following error
>> occurred while executing this line:
>> /home/coec/git/spacewalk/java/buildconf/build-props.xml:84: Could not
>> create task or type of type: if.
>>
>> Ant could not find the task or a class this task relies upon.
>>
>> This is common and has a number of causes; the usual
>> solutions are to read the manual pages then download and
>> install needed JAR files, or fix the build file:
>>  - You have misspelt 'if'.
>>    Fix: check your spelling.
>>  - The task needs an external JAR file to execute
>>      and this is not found at the right place in the classpath.
>>    Fix: check the documentation for dependencies.
>>    Fix: declare the task.
>>  - The task is an Ant optional task and the JAR file and/or libraries
>>      implementing the functionality were not found at the time you
>>      yourself built your installation of Ant from the Ant sources.
>>    Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
>>      task and make sure it contains more than merely a
>> META-INF/MANIFEST.MF.
>>      If all it contains is the manifest, then rebuild Ant with the needed
>>      libraries present in ${ant.home}/lib/optional/ , or alternatively,
>>      download a pre-built release version from apache.org
>>  - The build file was written for a later version of Ant
>>    Fix: upgrade to at least the latest release version of Ant
>>  - The task is not an Ant core or optional task
>>      and needs to be declared using.
>>  - You are attempting to use a task defined using
>>       or  but have spelt wrong or not
>>    defined it at the point of use
>>
>> Remember that for JAR files to be visible to Ant tasks implemented
>> in ANT_HOME/lib, the files must be in the same directory or on the
>> classpath
>>
>> Please neither file bug reports on this problem, nor email the
>> Ant mailing lists, until all of these causes have been explored,
>> as this is not an Ant bug.
>>
>> Total time: 0 seconds
>> ---
>>
>> Having a look at line 84 in
>> '/home/coec/git/spacewalk/java/buildconf/build-props.xml' it does look
>> related to this change, apologies if my problem is between the chair
>> and keyboard or just local to my setup.
>>
>> Could you advise?
>>
>> Thanks
>>
>> CC
>>
>> On Wed, Jul 21, 2010 at 6:28 AM, Justin Sherrill
>>  wrote:
>>
>>>
>>> Hey Milan,
>>>
>>> I've made the changes that I think should get spacewalk-java  and tomcat6
>>> working on Fedora 13.  Fedora 13 had a newer version of cglib which
>>> required
>>> objectweb-asm (instead of the older asm we were using before).
>>>
>>> It took me a while to figure out the java build scripts, but It should be
>>> fixed.
>>>
>>> I build new packages within koji and tested them on your internal
>>> reproducer
>>> and the new packages worked great!  Let me know if you see any issues.
>>>
>>> Thanks,
>>>
>>> -Justin
>>>
>>> ___
>>> Spacewalk-devel mailing list
>>> Spacewalk-devel@redhat.com
>>> https://www.redhat.com/mailman/listinfo/spacewalk-devel
>>>
>>>
>>
>>
>>
>
> Hey Colin,
>
> I just committed a fix that should resolve it.  Mind giving it a try?
>
> Thanks,
>
> -Justin
>
> ___
> Spacewalk-devel mailing list
> Spacewalk-devel@redhat.com
> https://www.re

[Spacewalk-devel] What do I do with all those potential bugzillas ?

2010-07-21 Thread Jerome Fenal
Hi all,

still ongoing on my Perl OO API for Spacewalk/Satellite, I have
collected quite a few glitches during development (unit test helps
here).

As the number is growing, I'm getting a bit concerned of not taking care
of those... :)

You can find those here :
http://github.com/jfenal/RHNC/blob/master/Bugzillas.txt

Do you want me to open a bugzilla for each of those, or may I
subcontract this to the list or any other taker here ? :)
Some should be quite easy to fix, as they mainly seem javadoc issues in
the handlers code, but I'm not a Java developer.

Hints are welcome, or help :)
I'll do the filing if needed. And if someone wants to write the test
cases, that is a good exercise and my too few spare time will thank
you ;)

Regards, thanks in advance with your answers,

J.
-- 
Jérôme Fenal, RHCETel.: +33 1 41 91 23 37
Solution ArchitectMob.: +33 6 88 06 51 15
Architecte Solutions  Fax.: +33 1 41 91 23 32
http://www.fr.redhat.com/   jfe...@redhat.com
Red Hat France SARLSiret n° 421 199 464 00064
Le Linea, 1 rue du Général Leclerc   92047 Paris La Défense Cedex
JBoss Open Choicehttp://www.jboss.com/solutions/javaapps/

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

Re: [Spacewalk-devel] [PATCH] added new API call system.listLatestAvailablePackage that will list the latest available version of a package for each system in the list

2010-07-21 Thread Aron Parsons
Returning a hash in system.listLatestAvailablePackage didn't work in practice.  
This patch
alters the return type to an array that includes the system id, name and then a 
hash
of the package information.

/aron

- Original Message -
From: "Aron Parsons" 
To: "spacewalk-devel" 
Sent: Wednesday, July 21, 2010 2:01:02 PM GMT -05:00 US/Canada Eastern
Subject: [Spacewalk-devel] [PATCH] added new API call 
system.listLatestAvailablePackage that will list the latest available version 
of a package for each system in the list

This patch adds a new API call that allows you to get the latest available 
version of a package
for each system in a list.  

The use case for this in spacecmd is to be able to do a 'system_installpackage 
ssm ', which
currently is quite slow because it has to call 
system.listLatestInstallablePackages() for each
system to see which packages are available.  By implementing this API method, a 
single call
can be made to the server to get the information, which can then be used to 
schedule the installations.

/aron

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel>From 23b8db5c3478d59dfddab590c637fda5aedc0ac7 Mon Sep 17 00:00:00 2001
From: Aron Parsons 
Date: Wed, 21 Jul 2010 17:08:06 -0400
Subject: [PATCH 2/2] alter the return type of system.listLatestAvailablePackage

---
 .../rhn/frontend/xmlrpc/system/SystemHandler.java  |   27 ++--
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index 6ce5eb5..94159c3 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -1049,25 +1049,32 @@ public class SystemHandler extends BaseHandler {
  * @xmlrpc.param #param("string", "sessionKey")
  * @xmlrpc.param #array_single("int", "serverId")
  * @xmlrpc.param #param("string", "packageName")
- * @xmlrpc.returntype #struct("systems")
- *  #prop("int", "serverId")
- *  #struct("latest package")
+ * @xmlrpc.returntype
+ *  #array()
+ *#prop_desc("int", "id", "server ID")
+ *#prop_desc("string", "name", "server name")
+ *#struct("package")
  *  #prop("int", "id")
  *  #prop("string", "name")
  *  #prop("string", "version")
  *  #prop("string", "release")
  *  #prop("string", "epoch")
  *  #prop("string", "arch")
- *  #struct_end()
+ *  #array_end()
+ *
  */
-public Map listLatestAvailablePackage(String sessionKey, List systemIds, String name)
+public List listLatestAvailablePackage(String sessionKey, List systemIds, String name)
 throws FaultException {
 // Get the logged in user
 User loggedInUser = getLoggedInUser(sessionKey);
 
-Map results = new HashMap();
+List list = new ArrayList();
 
 for (Integer sid : systemIds) {
+Server server = lookupServer(loggedInUser, sid);
+
+Map systemMap = new HashMap();
+
 // get the package name ID
 Map pkgEvr = PackageManager.lookupEvrIdByPackageName(sid.longValue(), name);
 
@@ -1092,12 +1099,16 @@ public class SystemHandler extends BaseHandler {
 pkgMap.put("epoch", "");
 }
 
-results.put(sid, pkgMap);
+systemMap.put("id", sid);
+systemMap.put("name", server.getName());
+systemMap.put("package", pkgMap);
+
+list.add(systemMap);
 }
 }
 }
 
-return results;
+return list;
 }
 
 /**
-- 
1.7.1.1

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

[Spacewalk-devel] [PATCH] added new API call system.listLatestAvailablePackage that will list the latest available version of a package for each system in the list

2010-07-21 Thread Aron Parsons
This patch adds a new API call that allows you to get the latest available 
version of a package
for each system in a list.  

The use case for this in spacecmd is to be able to do a 'system_installpackage 
ssm ', which
currently is quite slow because it has to call 
system.listLatestInstallablePackages() for each
system to see which packages are available.  By implementing this API method, a 
single call
can be made to the server to get the information, which can then be used to 
schedule the installations.

/aron
>From a1a92364dd31f190bb37468d95156004eeb37abe Mon Sep 17 00:00:00 2001
From: Aron Parsons 
Date: Wed, 21 Jul 2010 13:51:35 -0400
Subject: [PATCH] added new API call system.listLatestAvailablePackage that will list the latest available version of a package for each system in the list

---
 .../rhn/frontend/xmlrpc/system/SystemHandler.java  |   63 
 1 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index 2d16d0a..ff4a6c7 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -1038,6 +1038,69 @@ public class SystemHandler extends BaseHandler {
 }
 
 /**
+ * Get the latest available version of a package for each system
+ * @param sessionKey The sessionKey containing the logged in user
+ * @param systemIds The IDs of the systems in question
+ * @return Returns an a map with the latest available package for each system
+ * @throws FaultException A FaultException is thrown if the server corresponding to
+ * sid cannot be found.
+ *
+ * @xmlrpc.doc Get the latest available version of a package for each system
+ * @xmlrpc.param #param("string", "sessionKey")
+ * @xmlrpc.param #array_single("int", "serverId")
+ * @xmlrpc.param #param("string", "packageName")
+ * @xmlrpc.returntype #struct("systems")
+ *  #prop("int", "serverId")
+ *  #struct("latest package")
+ *  #prop("int", "id")
+ *  #prop("string", "name")
+ *  #prop("string", "version")
+ *  #prop("string", "release")
+ *  #prop("string", "epoch")
+ *  #prop("string", "arch")
+ *  #struct_end()
+ */
+public Map listLatestAvailablePackage(String sessionKey, List systemIds, String name) 
+throws FaultException {
+// Get the logged in user
+User loggedInUser = getLoggedInUser(sessionKey);
+
+Map results = new HashMap();
+
+for (Integer sid : systemIds) {
+// get the package name ID
+Map pkgEvr = PackageManager.lookupEvrIdByPackageName(sid.longValue(), name);
+
+if (pkgEvr != null) {
+// find the latest package available to each system
+Package pkg = PackageManager.guestimatePackageBySystem(sid.longValue(),
+(Long) pkgEvr.get("name_id"), (Long) pkgEvr.get("evr_id"),
+ null, loggedInUser.getOrg());
+
+// build the hash to return
+if (pkg != null) {
+HashMap pkgMap = new HashMap();
+pkgMap.put("id", pkg.getId());
+pkgMap.put("name", pkg.getPackageName().getName());
+pkgMap.put("version", pkg.getPackageEvr().getVersion());
+pkgMap.put("release", pkg.getPackageEvr().getRelease());
+pkgMap.put("arch", pkg.getPackageArch().getLabel());
+
+if (pkg.getPackageEvr().getEpoch() != null) {
+pkgMap.put("epoch", pkg.getPackageEvr().getEpoch());
+} else {
+pkgMap.put("epoch", "");
+}
+
+results.put(sid, pkgMap);
+}
+}
+}
+
+return results;
+}
+
+/**
  * Gets the entitlements for a given server.
  * @param sessionKey The sessionKey containing the logged in user
  * @param sid The id for the system in question
-- 
1.5.5.6

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

[Spacewalk-devel] Suggestions for sysdate, for PostgreSQL?

2010-07-21 Thread Jan Pazdziora
On Fri, Jul 09, 2010 at 04:40:12PM +0200, Jan Pazdziora wrote:
> 
> - ... and then it's just business as usual -- fix bugs that you see in
>   catalina.out and other logs.
>   - For example, we will need to do something about sysdate. ;-)

Hello,

what are our possibilities for handling sysdate in PostgreSQL.

The word sysdate appears on more than 200 lines in our code base, not
counting the schema definition itself where it's already been
converted to current_timestamp. On these remaining lines, it is send
as part of the SQL queries to the server.

Are we able to create an object in PostgreSQL schema which would
behave as current_timestamp but which would be called sysdate?
Function seems to require parentheses upon invocation so that probably
cannot be used.

Another possibility is to modify the SQL on the fly, while it's being
sent to the server, similar to what I did for the Python stack and the
anonymous PL/SQL codes. Would it be reasonable to do a regexp replace
on every command sent to the PostgreSQL server? Any performance
implications? How would we do that for Java connections?

Another option is to modify the sources not to use sysdate but (say)
xsysdate(), or maybe now(), and define that xsysdate function both in
Oracle and PostgreSQL to do the right thing. The problem with this
approach is that it might have potential performance impact on the
Oracle side, as having function where it had plain sysdate might
prevent it to do optimizations that it was able to do before, thus
slowing the operations down.

Any other options?

What do people think?

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

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


Re: [Spacewalk-devel] PostgreSQL status

2010-07-21 Thread Jan Pazdziora
On Fri, Jul 09, 2010 at 07:37:48PM -0400, Tom Lane wrote:
> 
> Personally though I'm more interested in an F-13 build.

Tom,

the nightly F-13 repo seems installable now for spacewalk-oracle, but
for spacewalk-postgresql we are missing the python-pgsql dependency.

The package seems to have been orphaned, based on


http://www.redhat.com/archives/rhl-devel-list/2009-September/msg00655.html

Do you know what our options for Fedora 13 are? Do we want to bring
python-pgsql back, or use some other package/module?

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

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


Re: [Spacewalk-devel] PostgreSQL status

2010-07-21 Thread Jan Pazdziora
On Wed, Jul 21, 2010 at 09:03:23AM -0400, Justin Sherrill wrote:
> On 7/21/10 8:22 AM, Jan Pazdziora wrote:
> >On Tue, Jul 20, 2010 at 06:25:06PM -0400, Justin Sherrill wrote:
> >>I've finished those changes and have built packages.  If you could
> >>give them a try, that'd be awesome :}
> >>
> >>The newest spacewalk-java within koji are the ones you want.  I
> >>believe they now pass all the unit tests on oracle, so oracle should
> >>be good.
> >Thanks. This seems to be solving the issue on PostgreSQL as well. I'm
> >not saying it selects the blobs correctly, we are not there yet, but I
> >no longer get the errors I used to be getting upon tomcat startup.
> >
> If you want to do a quick test (and don't get any other errors along
> the way), go to Systems->kickstart->profiles->select a profile (or
> create one) -> scripts -> create a script
> 
> If you can create a script and it gets read correctly, then it
> should be working.

Hehe. That was a good one. ;-)

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

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


Re: [Spacewalk-devel] PostgreSQL status

2010-07-21 Thread Jan Pazdziora
On Fri, Jul 09, 2010 at 04:40:12PM +0200, Jan Pazdziora wrote:
> 
> Hello,
> 
> in the past couple of weeks, I've been looking at the status of
> PostgreSQL database backend for Spacewalk, trying to get it install
> and at least start.
> 
> I've summarized my findings at
> 
>   https://fedorahosted.org/spacewalk/wiki/PostgreSQL
> 
> and I've also linked this page from HowToInstall, so please consider
> this to be the primary resource for the PostgreSQL port. All the
> other pages are describing the situation back for Spacewalk 0.6.
> 
> The overview is:
> 
> - You should be able to install Spacewalk with PostgreSQL backend and
>   get to /rhn/YourRhn.do web page.
> - You should not expect anything beyond that; even this page will give
>   you error popups for those panes.
> - It only works on Fedora 12.
> - You need to patch spacewalk-java to remove reference to blob
>   columns to start tomcat6 -- link to 1.1.21 packages with this patch
>   is provided.
>   - Better solution is needed.

Hello,

Justin built new spacewalk-java so if you want to try to install
Spacewalk nightly with PostgreSQL on Fedora 12 to hack, you can just
use the nightly repo from


http://koji.spacewalkproject.org/spacewalk/split/spacewalk-f12/server/spacewalk-f12-1.1/

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

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


Re: [Spacewalk-devel] spacewalk-java on Fedora 13

2010-07-21 Thread Justin Sherrill

On 7/21/10 8:47 AM, Colin Coe wrote:

HI Justin

I'm building another spacewalk dev system (32bit RHEL5 fully patched)
and when I run the 'ant all' in the dev setup instructions
(https://fedorahosted.org/spacewalk/wiki/DevelopmentWorkstationSetup)
I'm getting this error:
---
Buildfile: build.xml
   [taskdef] Could not load definitions from resource
net/sf/antcontrib/antcontrib.properties. It could not be found.

BUILD FAILED
/home/coec/git/spacewalk/java/build.xml:8: The following error
occurred while executing this line:
/home/coec/git/spacewalk/java/buildconf/build-props.xml:84: Could not
create task or type of type: if.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
  - You have misspelt 'if'.
Fix: check your spelling.
  - The task needs an external JAR file to execute
  and this is not found at the right place in the classpath.
Fix: check the documentation for dependencies.
Fix: declare the task.
  - The task is an Ant optional task and the JAR file and/or libraries
  implementing the functionality were not found at the time you
  yourself built your installation of Ant from the Ant sources.
Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
  task and make sure it contains more than merely a META-INF/MANIFEST.MF.
  If all it contains is the manifest, then rebuild Ant with the needed
  libraries present in ${ant.home}/lib/optional/ , or alternatively,
  download a pre-built release version from apache.org
  - The build file was written for a later version of Ant
Fix: upgrade to at least the latest release version of Ant
  - The task is not an Ant core or optional task
  and needs to be declared using.
  - You are attempting to use a task defined using
   or  but have spelt wrong or not
defined it at the point of use

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.

Total time: 0 seconds
---

Having a look at line 84 in
'/home/coec/git/spacewalk/java/buildconf/build-props.xml' it does look
related to this change, apologies if my problem is between the chair
and keyboard or just local to my setup.

Could you advise?

Thanks

CC

On Wed, Jul 21, 2010 at 6:28 AM, Justin Sherrill  wrote:
   

Hey Milan,

I've made the changes that I think should get spacewalk-java  and tomcat6
working on Fedora 13.  Fedora 13 had a newer version of cglib which required
objectweb-asm (instead of the older asm we were using before).

It took me a while to figure out the java build scripts, but It should be
fixed.

I build new packages within koji and tested them on your internal reproducer
and the new packages worked great!  Let me know if you see any issues.

Thanks,

-Justin

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

 



   


Hey Colin,

I just committed a fix that should resolve it.  Mind giving it a try?

Thanks,

-Justin

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


Re: [Spacewalk-devel] spacewalk-java on Fedora 13

2010-07-21 Thread Justin Sherrill

On 7/21/10 8:47 AM, Colin Coe wrote:

HI Justin

I'm building another spacewalk dev system (32bit RHEL5 fully patched)
and when I run the 'ant all' in the dev setup instructions
(https://fedorahosted.org/spacewalk/wiki/DevelopmentWorkstationSetup)
I'm getting this error:
---
Buildfile: build.xml
   [taskdef] Could not load definitions from resource
net/sf/antcontrib/antcontrib.properties. It could not be found.

BUILD FAILED
/home/coec/git/spacewalk/java/build.xml:8: The following error
occurred while executing this line:
/home/coec/git/spacewalk/java/buildconf/build-props.xml:84: Could not
create task or type of type: if.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
  - You have misspelt 'if'.
Fix: check your spelling.
  - The task needs an external JAR file to execute
  and this is not found at the right place in the classpath.
Fix: check the documentation for dependencies.
Fix: declare the task.
  - The task is an Ant optional task and the JAR file and/or libraries
  implementing the functionality were not found at the time you
  yourself built your installation of Ant from the Ant sources.
Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
  task and make sure it contains more than merely a META-INF/MANIFEST.MF.
  If all it contains is the manifest, then rebuild Ant with the needed
  libraries present in ${ant.home}/lib/optional/ , or alternatively,
  download a pre-built release version from apache.org
  - The build file was written for a later version of Ant
Fix: upgrade to at least the latest release version of Ant
  - The task is not an Ant core or optional task
  and needs to be declared using.
  - You are attempting to use a task defined using
   or  but have spelt wrong or not
defined it at the point of use

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.

Total time: 0 seconds
---

Having a look at line 84 in
'/home/coec/git/spacewalk/java/buildconf/build-props.xml' it does look
related to this change, apologies if my problem is between the chair
and keyboard or just local to my setup.

Could you advise?

Thanks

CC

On Wed, Jul 21, 2010 at 6:28 AM, Justin Sherrill  wrote:
   

Hey Milan,

I've made the changes that I think should get spacewalk-java  and tomcat6
working on Fedora 13.  Fedora 13 had a newer version of cglib which required
objectweb-asm (instead of the older asm we were using before).

It took me a while to figure out the java build scripts, but It should be
fixed.

I build new packages within koji and tested them on your internal reproducer
and the new packages worked great!  Let me know if you see any issues.

Thanks,

-Justin

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

 



   

Ah shoot.  I'll take a look at this.

-Justin

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


Re: [Spacewalk-devel] PostgreSQL status

2010-07-21 Thread Justin Sherrill

On 7/21/10 8:22 AM, Jan Pazdziora wrote:

On Tue, Jul 20, 2010 at 06:25:06PM -0400, Justin Sherrill wrote:
   

I've finished those changes and have built packages.  If you could
give them a try, that'd be awesome :}

The newest spacewalk-java within koji are the ones you want.  I
believe they now pass all the unit tests on oracle, so oracle should
be good.
 

Thanks. This seems to be solving the issue on PostgreSQL as well. I'm
not saying it selects the blobs correctly, we are not there yet, but I
no longer get the errors I used to be getting upon tomcat startup.

   
If you want to do a quick test (and don't get any other errors along the 
way), go to Systems->kickstart->profiles->select a profile (or create 
one) -> scripts -> create a script


If you can create a script and it gets read correctly, then it should be 
working.


-Justin

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


Re: [Spacewalk-devel] spacewalk-java on Fedora 13

2010-07-21 Thread Colin Coe
HI Justin

I'm building another spacewalk dev system (32bit RHEL5 fully patched)
and when I run the 'ant all' in the dev setup instructions
(https://fedorahosted.org/spacewalk/wiki/DevelopmentWorkstationSetup)
I'm getting this error:
---
Buildfile: build.xml
  [taskdef] Could not load definitions from resource
net/sf/antcontrib/antcontrib.properties. It could not be found.

BUILD FAILED
/home/coec/git/spacewalk/java/build.xml:8: The following error
occurred while executing this line:
/home/coec/git/spacewalk/java/buildconf/build-props.xml:84: Could not
create task or type of type: if.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
 - You have misspelt 'if'.
   Fix: check your spelling.
 - The task needs an external JAR file to execute
 and this is not found at the right place in the classpath.
   Fix: check the documentation for dependencies.
   Fix: declare the task.
 - The task is an Ant optional task and the JAR file and/or libraries
 implementing the functionality were not found at the time you
 yourself built your installation of Ant from the Ant sources.
   Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
 task and make sure it contains more than merely a META-INF/MANIFEST.MF.
 If all it contains is the manifest, then rebuild Ant with the needed
 libraries present in ${ant.home}/lib/optional/ , or alternatively,
 download a pre-built release version from apache.org
 - The build file was written for a later version of Ant
   Fix: upgrade to at least the latest release version of Ant
 - The task is not an Ant core or optional task
 and needs to be declared using .
 - You are attempting to use a task defined using
 or  but have spelt wrong or not
   defined it at the point of use

Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath

Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.

Total time: 0 seconds
---

Having a look at line 84 in
'/home/coec/git/spacewalk/java/buildconf/build-props.xml' it does look
related to this change, apologies if my problem is between the chair
and keyboard or just local to my setup.

Could you advise?

Thanks

CC

On Wed, Jul 21, 2010 at 6:28 AM, Justin Sherrill  wrote:
> Hey Milan,
>
> I've made the changes that I think should get spacewalk-java  and tomcat6
> working on Fedora 13.  Fedora 13 had a newer version of cglib which required
> objectweb-asm (instead of the older asm we were using before).
>
> It took me a while to figure out the java build scripts, but It should be
> fixed.
>
> I build new packages within koji and tested them on your internal reproducer
> and the new packages worked great!  Let me know if you see any issues.
>
> Thanks,
>
> -Justin
>
> ___
> Spacewalk-devel mailing list
> Spacewalk-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-devel
>



-- 
RHCE#805007969328369

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


Re: [Spacewalk-devel] PostgreSQL status

2010-07-21 Thread Jan Pazdziora
On Tue, Jul 20, 2010 at 06:25:06PM -0400, Justin Sherrill wrote:
> 
> I've finished those changes and have built packages.  If you could
> give them a try, that'd be awesome :}
> 
> The newest spacewalk-java within koji are the ones you want.  I
> believe they now pass all the unit tests on oracle, so oracle should
> be good.

Thanks. This seems to be solving the issue on PostgreSQL as well. I'm
not saying it selects the blobs correctly, we are not there yet, but I
no longer get the errors I used to be getting upon tomcat startup.

-- 
Jan Pazdziora
Principal Software Engineer, Satellite Engineering, Red Hat

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