Skip to content

Commit

Permalink
Merge "config/common: fix functions that by-pass cassandra api"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins CI authored and opencontrail-ci-admin committed Sep 9, 2020
2 parents 994ed07 + b012af8 commit 4f3b7bb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/config/common/cfgm_common/vnc_cassandra.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,21 @@ def _is_children(column_name):

def add(self, cf_name, key, value):
try:
self._cassandra_driver.get_cf(cf_name).insert(key, value)
self._cassandra_driver.insert(key, value, cf_name=cf_name)
return True
except:
except Exception as e:
self._logger("VNCCassandra, unable to add {}={}, error: {}".format(
key, value, e), level=SandeshLevel.SYS_WARN)
return False

def delete(self, cf_name, key, columns=None):
try:
self._cassandra_driver.get_cf(cf_name).remove(key, columns=columns)
self._cassandra_driver.remove(
key, columns, cf_name=cf_name)
return True
except:
except Exception as e:
self._logger("VNCCassandra, unable to del {}={}, error: {}".format(
key, columns, e), level=SandeshLevel.SYS_WARN)
return False

def _get_resource_class(self, obj_type):
Expand Down

0 comments on commit 4f3b7bb

Please sign in to comment.