On 16/12/14 13:00, Martin Kosek wrote:
On 12/16/2014 12:30 PM, Martin Basti wrote:
On 11/12/14 12:13, Martin Basti wrote:
On 11/12/14 11:19, Jan Cholasta wrote:
Hi,

Dne 9.12.2014 v 16:07 Martin Basti napsal(a):
Ticket: https://fedorahosted.org/freeipa/ticket/4793

I'm able to reproduce it only in one nose test.
Which test?
If you apply my patch 170 and add a random forwardzone, then DNS root zone
tests failed.
Patch attached.
What about:

     result['messages'] = result.get('messages', ()) + (message.to_dict(),)

(My point is, don't support both lists and tuples, pick just one.)

Honza

This is question for framework guru (you?), I tried to preserve format
unchanged.
Shouldn't be all values in lists in server part?

Martin^2

As was requested, I convert tuple to list instead handling both types.

Updated patch attached.
I assume you do not want to track the  .idea/ files in FreeIPA git :-)

Oh, thanks. My IDE was too smart again and add those files there itself.

updated patch attached

--
Martin Basti

From dae3109cb3b1ba9ae95c2b4cf44c94b22846584f Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Tue, 16 Dec 2014 13:02:12 +0100
Subject: [PATCH] Fix warning message on client side

https://fedorahosted.org/freeipa/ticket/4793
---
 ipalib/frontend.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index a9a3dfeaac2ab7047c036ea7bbed7655dd93be56..565e1af29df5d39b80048f2af33281a31c374b9e 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -438,6 +438,12 @@ class Command(HasParam):
         (args, options) = self.params_2_args_options(**params)
         ret = self.run(*args, **options)
         if not version_provided and isinstance(ret, dict):
+            # on client side the messages can be stored in tuple
+            # convert them into list first
+            ret_messages = ret.get('messages')
+            if isinstance(ret_messages, tuple):
+                ret['messages'] = list(ret_messages)
+
             messages.add_message(
                 API_VERSION, ret,
                 messages.VersionMissing(server_version=API_VERSION))
-- 
1.8.3.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to