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?

-- 
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

Reply via email to