From cbfc28fa486688498a142941323ca39da12a84e7 Mon Sep 17 00:00:00 2001 From: yangzhenyu Date: Tue, 31 Oct 2017 19:08:58 +0800 Subject: [PATCH] Update queue metadata failed when the original value is zero. Such as the problem, the current set or update the queue of metadata, it may fail. The reproduction steps are as follows: - Set or update the metadata to 0 (some metadata can be zero). - And then update it again will fail (always 0), because 0 was filter by client. Closes-Bug: #1729193 Change-Id: I4e3c4aa3634ba33e4e9501c6c27bac77c0e43ea8 --- zaqarclient/queues/v2/queues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zaqarclient/queues/v2/queues.py b/zaqarclient/queues/v2/queues.py index 77385ee6..8f137673 100644 --- a/zaqarclient/queues/v2/queues.py +++ b/zaqarclient/queues/v2/queues.py @@ -62,7 +62,7 @@ class Queue(queues.Queue): changes = [] for key, value in new_meta.items(): # If key exists, replace it's value. - if self._metadata.get(key, None): + if self._metadata.get(key, None) is not None: changes.append({'op': 'replace', 'path': '/metadata/%s' % key, 'value': value})