def test_update_hp_ironic_swport_map_with_bind_req(self):
     """Test update_hp_ironic_swport_map_with_bind_req method."""
     rec_dict = self._get_ironic_switch_port_map_dict()
     db.add_hp_ironic_switch_port_mapping(self.ctx, rec_dict)
     db.update_hp_ironic_swport_map_with_bind_req(
         self.ctx, {'neutron_port_id': "n1234",
                    'bind_requested': False})
     result = db.get_hp_ironic_swport_map_by_id(
         self.ctx, {'neutron_port_id': "n1234"})
     self.assertEqual(False, result.bind_requested)
Exemplo n.º 2
0
 def test_update_hp_ironic_swport_map_with_bind_req(self):
     """Test update_hp_ironic_swport_map_with_bind_req method."""
     rec_dict = self._get_ironic_switch_port_map_dict()
     db.add_hp_ironic_switch_port_mapping(self.ctx, rec_dict)
     db.update_hp_ironic_swport_map_with_bind_req(self.ctx, {
         'neutron_port_id': "n1234",
         'bind_requested': False
     })
     result = db.get_hp_ironic_swport_map_by_id(
         self.ctx, {'neutron_port_id': "n1234"})
     self.assertEqual(False, result.bind_requested)
    def update_port(self, port_dict):
        """update_port. This call makes the REST request to the external

        SDN controller for provision VLAN on switch port where bare metal
        is connected.
        """
        LOG.debug("update_port with port dict %(port_dict)s",
                  {'port_dict': port_dict})
        port_id = port_dict['port']['id']
        bind_requested = port_dict['port']['bind_requested']
        update_dict = {'neutron_port_id': port_id,
                       'bind_requested': bind_requested}
        db.update_hp_ironic_swport_map_with_bind_req(self.context,
                                                     update_dict)
    def update_port(self, port_dict):
        """update_port. This call makes the REST request to the external

        SDN controller for provision VLAN on switch port where bare metal
        is connected.
        """
        LOG.debug("update_port with port dict %(port_dict)s",
                  {'port_dict': port_dict})
        port_id = port_dict['port']['id']
        bind_requested = port_dict['port']['bind_requested']
        update_dict = {
            'neutron_port_id': port_id,
            'bind_requested': bind_requested
        }
        db.update_hp_ironic_swport_map_with_bind_req(self.context, update_dict)