]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove useless check in _rpc_update_firewall
authorCedric Brandily <zzelle@gmail.com>
Wed, 27 Aug 2014 09:35:41 +0000 (11:35 +0200)
committerCedric Brandily <zzelle@gmail.com>
Wed, 10 Sep 2014 20:18:49 +0000 (20:18 +0000)
Firewall_db_mixin.update_firewall returns an updated firewall or raises
an error (if the firewall is not found), that's why checking if its
result is evaluated to False is not required

Change-Id: Ib4e2fa0920783728b8e1cc8597b3edf78e098b52

neutron/services/firewall/fwaas_plugin.py

index 6a9fd1c5439e65b12295dd7156ed93ae2d4ae34d..b44e8fb6b2d03f8a39a92142331db78219ed307d 100644 (file)
@@ -182,13 +182,11 @@ class FirewallPlugin(firewall_db.Firewall_db_mixin):
 
     def _rpc_update_firewall(self, context, firewall_id):
         status_update = {"firewall": {"status": const.PENDING_UPDATE}}
-        fw = super(FirewallPlugin, self).update_firewall(context, firewall_id,
-                                                         status_update)
-        if fw:
-            fw_with_rules = (
-                self._make_firewall_dict_with_rules(context,
-                                                    firewall_id))
-            self.agent_rpc.update_firewall(context, fw_with_rules)
+        super(FirewallPlugin, self).update_firewall(context, firewall_id,
+                                                    status_update)
+        fw_with_rules = self._make_firewall_dict_with_rules(context,
+                                                            firewall_id)
+        self.agent_rpc.update_firewall(context, fw_with_rules)
 
     def _rpc_update_firewall_policy(self, context, firewall_policy_id):
         firewall_policy = self.get_firewall_policy(context, firewall_policy_id)