summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-16 00:57:47 +0000
committerGerrit Code Review <review@openstack.org>2018-10-16 00:57:47 +0000
commit76ce85596279005ae16dbf6320d60c34395c2d04 (patch)
tree0f7dece35eae2cf22f5928e95cdda67633faba1d
parentc9cca1170b1d6b8e20698482e1928c8f0f2e0eef (diff)
parent41447d63fb5fbedd60bcb57db304f12a797a58ff (diff)
Merge "Create default security group in TF with different name"
-rw-r--r--networking_opencontrail/ml2/mech_driver.py4
-rw-r--r--networking_opencontrail/tests/unit/ml2/test_oc_mech_driver.py2
2 files changed, 5 insertions, 1 deletions
diff --git a/networking_opencontrail/ml2/mech_driver.py b/networking_opencontrail/ml2/mech_driver.py
index 95f1778..70d3a01 100644
--- a/networking_opencontrail/ml2/mech_driver.py
+++ b/networking_opencontrail/ml2/mech_driver.py
@@ -150,6 +150,10 @@ class OpenContrailMechDriver(api.MechanismDriver):
150 150
151 def create_security_group(self, context, sg): 151 def create_security_group(self, context, sg):
152 """Create a Security Group in OpenContrail.""" 152 """Create a Security Group in OpenContrail."""
153 # vnc_openstack does not allow to create default security group
154 if sg.get('name') == 'default':
155 sg['name'] = 'default-openstack'
156 sg['description'] = 'default-openstack security group'
153 sec_g = {'security_group': sg} 157 sec_g = {'security_group': sg}
154 try: 158 try:
155 self.drv.create_security_group(context, sec_g) 159 self.drv.create_security_group(context, sec_g)
diff --git a/networking_opencontrail/tests/unit/ml2/test_oc_mech_driver.py b/networking_opencontrail/tests/unit/ml2/test_oc_mech_driver.py
index e940464..6e1810e 100644
--- a/networking_opencontrail/tests/unit/ml2/test_oc_mech_driver.py
+++ b/networking_opencontrail/tests/unit/ml2/test_oc_mech_driver.py
@@ -225,7 +225,7 @@ class OpenContrailTestCases(testlib_api.SqlTestCase):
225 225
226 def test_create_security_group(self): 226 def test_create_security_group(self):
227 ctx = fake_plugin_context('ten-1') 227 ctx = fake_plugin_context('ten-1')
228 sg = {'id': 'sg-1'} 228 sg = {'id': 'sg-1', 'name': 'test-security-group'}
229 self.drv.create_security_group(ctx, sg) 229 self.drv.create_security_group(ctx, sg)
230 230
231 expected_calls = [ 231 expected_calls = [