Esempio n. 1
0
 def update_port(self, tenant_id, net_id, port_id, port_state):
     """
     Updates the state of a port on the specified Virtual Network.
     """
     LOG.debug("update_port() called\n")
     network = db.network_get(net_id)
     self._invoke_device_plugins(self._func_name(), [tenant_id, net_id,
                                                  port_id, port_state])
     self._validate_port_state(port_state)
     db.port_set_state(net_id, port_id, port_state)
     new_port_dict = cutil.make_port_dict(port_id, port_state, net_id,
                                          None)
     return new_port_dict
Esempio n. 2
0
 def update_port(self, net_id, port_id, port_state):
     """Update a port"""
     try:
         port = db.port_set_state(net_id, port_id, port_state)
         LOG.debug("Updated port %s" % port.uuid)
         port_dict = {}
         port_dict["port-id"] = str(port.uuid)
         port_dict["net-id"] = str(port.network_id)
         port_dict["int-id"] = port.interface_id
         port_dict["state"] = port.state
         return port_dict
     except Exception, exc:
         raise Exception("Failed to update port state: %s" % str(exc))
Esempio n. 3
0
 def update_port(self, net_id, port_id, port_state):
     """Update a port."""
     try:
         port = db.port_set_state(net_id, port_id, port_state)
         LOG.debug("Updated port %s" % port.uuid)
         port_dict = {}
         port_dict["port-id"] = str(port.uuid)
         port_dict["net-id"] = str(port.network_id)
         port_dict["int-id"] = port.interface_id
         port_dict["state"] = port.state
         return port_dict
     except Exception as exc:
         raise Exception("Failed to update port state: %s" % str(exc))