[Kimchi-devel] [PATCH] [Wok] Fix to the WoK for the Kimchi issue #1102

Aline Manera alinefm at linux.vnet.ibm.com
Mon Jan 30 16:33:39 UTC 2017



On 01/30/2017 10:39 AM, Lucio Correia wrote:
> On 30/01/2017 09:35, jkatta at linux.vnet.ibm.com wrote:
>> From: Jayavardhan Katta <jkatta at linux.vnet.ibm.com>
>>
>> As a fix to the Kimchi issue #1102, some fix needs to be given for 
>> the WoK framework as well.
>>
>> Signed-off-by: Jayavardhan Katta <jkatta at linux.vnet.ibm.com>
>> ---
>>  src/wok/objectstore.py | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/wok/objectstore.py b/src/wok/objectstore.py
>> index a571e5f..eb49056 100644
>> --- a/src/wok/objectstore.py
>> +++ b/src/wok/objectstore.py
>> @@ -52,7 +52,7 @@ class ObjectStoreSession(object):
>>          objects.sort(key=lambda (_, obj): obj[sort_key])
>>          return [ident for ident, _ in objects]
>>
>> -    def get(self, obj_type, ident):
>> +    def get(self, obj_type, ident, ignore_missing=True):
>>          c = self.conn.cursor()
>>          res = c.execute('SELECT json FROM objects WHERE type=? AND 
>> id=?',
>>                          (obj_type, ident))
>> @@ -60,7 +60,10 @@ class ObjectStoreSession(object):
>>              jsonstr = res.fetchall()[0][0]
>>          except IndexError:
>>              self.conn.rollback()
>> -            raise NotFoundError("WOKOBJST0001E", {'item': ident})
>> +            data = {"":""}
>> +            jsonstr = json.dumps(data)
>> +            if ignore_missing:
>> +             raise NotFoundError("WOKOBJST0001E", {'item': ident})
>>          return json.loads(jsonstr)
>>
>>      def get_object_version(self, obj_type, ident):
>>
> Shouldn't it be "if not ignore_missing:"?
>
> I also believe the default value should be False, not True.
>

Yeap! I agree with Lucio.



More information about the Kimchi-devel mailing list