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

Reply via email to