[Spacewalk-list] spacewalk DB : rhnerrata table issue_date format

Tomas Lestach tlestach at redhat.com
Thu Oct 9 07:48:18 UTC 2014


============================================================================================
#!/bin/python

import xmlrpclib
import datetime

SATELLITE_URL = "http://<spacewalk-fqdn>/rpc/api"
SATELLITE_LOGIN = "<login>"
SATELLITE_PASSWORD = "<password>"
ADV = '<advisory>'

client = xmlrpclib.Server(SATELLITE_URL, verbose=0)
key = client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD)
print client.errata.getDetails(key, ADV);
#print client.errata.setDetails(key, ADV, {'update_date': datetime.datetime.today()});
print client.errata.setDetails(key, ADV, {'update_date': datetime.datetime(2014,10,03)});
print client.errata.getDetails(key, ADV);
client.auth.logout(key)
============================================================================================

Regards,
--
Tomas Lestach
Red Hat Satellite Engineering, Red Hat

----- Original Message -----
> From: "Glen Collins" <glenc2004 at comcast.net>
> To: spacewalk-list at redhat.com
> Sent: Wednesday, October 8, 2014 6:27:09 PM
> Subject: Re: [Spacewalk-list] spacewalk DB : rhnerrata table issue_date format
> 
> 
> 
> 
> By the way....I am using Postgres and not Oracle DB. I looked at the
> DB table and modified the date/time and added timezone and still get
> the same error....
> 
> 
> 20141003T00:00:00-07
> 
> 
> I assume this is the correct ISO8601 time format.
> 
> 
> Help!
> 
> 
> Glen Collins
> 
> 
> 
> 
> 
> Hi All. Now this is probably the wrong list to do this on but since
> I'm not a developer and don't code much this is a shot in the dark.
> I'm trying to update the rhnerrata table with the errata.set_details
> function and I can't seem to get the date format correct so it
> accepts the insert into the database. Can anyone provide the proper
> format of the date that's needed in this function?
> 
> 
> Here is what I have tried...
> 
> 
> 20141003T00:00:00:0000Z
> 
> 
> 20141003T00:00:00
> 
> 
> 2014-10-03T00:00:00
> 
> 
> And none of these formats work. I keep getting in the API log and in
> the screen....
> 
> 
> From API Log: redstone.xmlrpc.XmlRpcFault: Wrong 'issue_date' format
> 
> 
> On the screen from script run: Fault returned from XML RPC Server,
> fault code 1213: redstone.xmlrpc.XmlRpcFault: Wrong 'issue_date'
> format.
> 
> 
> Any help would be appreciated.
> 
> 
> Thanks!
> 
> 
> Glen Collins
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
> 
> 
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list




More information about the Spacewalk-list mailing list