Skip to content

Commit

Permalink
Merge "Do not create column if value is empty"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Oct 22, 2015
2 parents 2000e96 + 831cb87 commit 0cf976a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/config/schema-transformer/db.py
Expand Up @@ -12,6 +12,7 @@
from cfgm_common.zkclient import IndexAllocator
from cfgm_common.vnc_cassandra import VncCassandraClient
from sandesh_common.vns.constants import SCHEMA_KEYSPACE_NAME
import uuid

class SchemaTransformerDB(VncCassandraClient):

Expand Down Expand Up @@ -214,8 +215,12 @@ def get_service_chain_ip(self, sc_name):
return None, None

def add_service_chain_ip(self, sc_name, ip, ipv6):
self._sc_ip_cf.insert(sc_name, {'ip_address': ip,
'ipv6_address': ipv6})
val = {}
if ip:
val['ip_address'] = ip
if ipv6:
val['ipv6_address'] = ipv6
self._sc_ip_cf.insert(sc_name, val)

def remove_service_chain_ip(self, sc_name):
try:
Expand Down

0 comments on commit 0cf976a

Please sign in to comment.