expected conditions is a dict and each value is an object of ExpectedCondition instead of a list
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MagnetoDB |
Fix Released
|
Medium
|
Charles Wang |
Bug Description
When parsing expected conditions, all items are placed into a dict with attribute as key and condition as value. Each value in the expected condition map is an object of ExpectedCondition instead of a list. The following code in cassandra_impl.py assumes it is a list.
def _append_
init_length = len(query_builder)
for attr_name, cond_list in expected_
for condition in cond_list:
)
if len(query_builder) > init_length:
It should be changed to:
def _append_
init_length = len(query_builder)
for attr_name, condition in expected_
)
if len(query_builder) > init_length:
I have tried the fix with delta_item and update_item with conditions and the fix works. Without the fix, the conditional update and delete would fail.
Changed in magnetodb: | |
assignee: | nobody → Charles Wang (charles-wang) |
Changed in magnetodb: | |
milestone: | none → 2.0.4 |
importance: | Undecided → Medium |
Changed in magnetodb: | |
status: | Fix Committed → Fix Released |
Hi Charles, api/amz/ dynamodb/ parser. py api/openstack/ v1/parser. py attribute_ conditions methom which shold be rewritten to return map of list of Condition.
Yes I faced with this bug too. But I would prefer to fix this bug on the API side. Pleate take a look a look at magnetodb/
and magnetodb/
There is parse_expected_
Please send your patch to Gerrit review when you are ready