Skip to content

Commit

Permalink
portbinding values must be strings, not dict
Browse files Browse the repository at this point in the history
We store portbinding value as string (either plain or json encoded).
If this is stored as dict, the client will not be able to parse it correctly.
We made this change earlier, but one of the bindings that is created internally
is still being set as string. With this code, it will be converted to json
string before writing to database.

Change-Id: I0aa0040bb76c8f4eecb7530c0a744a5bc31b5daf
Closes-Bug: 1709822
  • Loading branch information
Sachin Bansal committed Aug 10, 2017
1 parent f6a1e6d commit e48307a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/config/api-server/vnc_cfg_types.py
Expand Up @@ -1116,7 +1116,7 @@ def pre_dbe_create(cls, tenant_name, obj_dict, db_conn):
vlan = vn_dict['provider_properties']['segmentation_id']
vif_params = {'port_filter': cls.portbindings['PORT_FILTER'],
'vlan': str(vlan)}
vif_details = {'key': 'vif_details', 'value': vif_params}
vif_details = {'key': 'vif_details', 'value': json.dumps(vif_params)}
kvps.append(vif_details)

if 'vif_type' not in kvp_dict:
Expand Down

0 comments on commit e48307a

Please sign in to comment.