]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
ovs, ofagent: Remove dead code
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Thu, 5 Jun 2014 07:03:28 +0000 (16:03 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Thu, 5 Jun 2014 07:05:22 +0000 (16:05 +0900)
Remove "class Port", which seems like a leftover from
the old days when agents had direct database accesses.

Change-Id: Ibc0bf5ab48f08ad620f87eb4952c7ff0f4701fda
Closes-Bug: #1326666

neutron/plugins/ofagent/agent/ofa_neutron_agent.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py

index c84e67c97c565abae98c7c7167487ee9dbe849a3..5a0b0416d023c87f3c2098ca1e4aa24ee845ae5b 100644 (file)
@@ -71,35 +71,6 @@ class LocalVLANMapping:
                  self.segmentation_id))
 
 
-class Port(object):
-    """Represents a neutron port.
-
-    Class stores port data in a ORM-free way, so attributres are
-    still available even if a row has been deleted.
-    """
-
-    def __init__(self, p):
-        self.id = p.id
-        self.network_id = p.network_id
-        self.device_id = p.device_id
-        self.admin_state_up = p.admin_state_up
-        self.status = p.status
-
-    def __eq__(self, other):
-        """Compare only fields that will cause us to re-wire."""
-        try:
-            return (other and self.id == other.id
-                    and self.admin_state_up == other.admin_state_up)
-        except Exception:
-            return False
-
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def __hash__(self):
-        return hash(self.id)
-
-
 class OVSBridge(ovs_lib.OVSBridge):
     def __init__(self, br_name, root_helper, ryuapp):
         super(OVSBridge, self).__init__(br_name, root_helper)
index c93e872c3e56a2cecf3ec8b65e252b66c2609eb3..101a95247cb80b75fb63027ff2a8322301e9aaa9 100644 (file)
@@ -70,36 +70,6 @@ class LocalVLANMapping:
                  self.segmentation_id))
 
 
-class Port(object):
-    """Represents a neutron port.
-
-    Class stores port data in a ORM-free way, so attributes are
-    still available even if a row has been deleted.
-    """
-
-    def __init__(self, p):
-        self.id = p.id
-        self.network_id = p.network_id
-        self.device_id = p.device_id
-        self.admin_state_up = p.admin_state_up
-        self.status = p.status
-
-    def __eq__(self, other):
-        '''Compare only fields that will cause us to re-wire.'''
-        try:
-            return (self and other
-                    and self.id == other.id
-                    and self.admin_state_up == other.admin_state_up)
-        except Exception:
-            return False
-
-    def __ne__(self, other):
-        return not self.__eq__(other)
-
-    def __hash__(self):
-        return hash(self.id)
-
-
 class OVSPluginApi(agent_rpc.PluginApi,
                    sg_rpc.SecurityGroupServerRpcApiMixin):
     pass