Skip to content

Commit

Permalink
Use empty string as default value for Security Group description
Browse files Browse the repository at this point in the history
* Return SG description field to empty string if none value.

Change-Id: Ic40c614b3bafbd93e50569d4c31fcfb584954e7a
Closes-Bug: #1766508
(cherry picked from commit e5e4322)
  • Loading branch information
suresh authored and bfernando committed Apr 26, 2018
1 parent 927bda8 commit c06a4a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py
Expand Up @@ -1144,7 +1144,10 @@ def _security_group_vnc_to_neutron(self, sg_obj, memo_req=None, oper=READ):
else:
sg_q_dict['name'] = sg_obj.display_name

# If description is not specified by the user, assign empty string
sg_q_dict['description'] = sg_obj.get_id_perms().get_description()
if not sg_q_dict['description']:
sg_q_dict['description'] = ""

# get security group rules
sg_q_dict['security_group_rules'] = []
Expand All @@ -1164,6 +1167,7 @@ def _security_group_vnc_to_neutron(self, sg_obj, memo_req=None, oper=READ):
def _security_group_neutron_to_vnc(self, sg_q, oper):
if oper == CREATE:
project_obj = self._get_project_obj(sg_q)

id_perms = IdPermsType(enable=True,
description=sg_q.get('description'))
sg_vnc = SecurityGroup(name=sg_q['name'],
Expand Down

0 comments on commit c06a4a6

Please sign in to comment.