LOG.exception(msg)
raise e
- except exceptions.BadRequest as e:
+ except exceptions.VcnsBadRequest as e:
self._firewall_set_status(
context, fw['id'], service_constants.ERROR)
LOG.exception(_("Bad Firewall request Input"))
return VSE_FWAAS_DENY
else:
msg = _("Invalid action value %s in a firewall rule") % action
- raise vcns_exc.BadRequest(resource='firewall_rule', msg=msg)
+ raise vcns_exc.VcnsBadRequest(resource='firewall_rule', msg=msg)
def _restore_firewall_action(self, action):
if action == VSE_FWAAS_ALLOW:
else:
msg = (_("Invalid action value %s in "
"a vshield firewall rule") % action)
- raise vcns_exc.BadRequest(resource='firewall_rule', msg=msg)
+ raise vcns_exc.VcnsBadRequest(resource='firewall_rule', msg=msg)
def _get_port_range_from_min_max_ports(self, min_port, max_port):
if not min_port:
else:
msg = _("Can't execute insert rule operation "
"without reference rule_id")
- raise vcns_exc.BadRequest(resource='firewall_rule', msg=msg)
+ raise vcns_exc.VcnsBadRequest(resource='firewall_rule', msg=msg)
for k, v in attrs.iteritems():
self.assertEqual(fw['firewall'][k], v)
+ def test_create_firewall_without_policy(self):
+ name = "new_fw"
+ attrs = self._get_test_firewall_attrs(name)
+ attrs['router_id'] = self._create_and_get_router()
+
+ with self.firewall(name=name,
+ router_id=attrs['router_id'],
+ admin_state_up=
+ test_db_firewall.ADMIN_STATE_UP,
+ expected_res_status=201) as fw:
+ attrs = self._replace_firewall_status(
+ attrs, const.PENDING_CREATE, const.ACTIVE)
+ for k, v in attrs.iteritems():
+ self.assertEqual(fw['firewall'][k], v)
+
def test_update_firewall(self):
name = "new_fw"
attrs = self._get_test_firewall_attrs(name)