コード例 #1
0
 def _create_port(self, network, device_owner):
     body = dict(port=dict(
         admin_state_up=True,
         network_id=network.id,
         device_id='%s' % socket.gethostname(),
         device_owner='%s:probe' % device_owner,
         tenant_id=network.tenant_id,
         fixed_ips=[dict(subnet_id=s.id) for s in network.subnets]))
     port_dict = self.client.create_port(body)['port']
     port = DictModel(port_dict)
     port.network = network
     for fixed_ip in port.fixed_ips:
         fixed_ip.subnet = self._get_subnet(fixed_ip.subnet_id)
     return port
コード例 #2
0
ファイル: debug_agent.py プロジェクト: CampHarmony/neutron
 def _create_port(self, network, device_owner):
     body = dict(port=dict(
         admin_state_up=True,
         network_id=network.id,
         device_id='%s' % socket.gethostname(),
         device_owner='%s:probe' % device_owner,
         tenant_id=network.tenant_id,
         fixed_ips=[dict(subnet_id=s.id) for s in network.subnets]))
     port_dict = self.client.create_port(body)['port']
     port = DictModel(port_dict)
     port.network = network
     for fixed_ip in port.fixed_ips:
         fixed_ip.subnet = self._get_subnet(fixed_ip.subnet_id)
     return port
コード例 #3
0
ファイル: debug_agent.py プロジェクト: Taejun/neutron
 def _create_port(self, network, device_owner):
     host = self.conf.host
     body = {'port': {'admin_state_up': True,
                      'network_id': network.id,
                      'device_id': '%s' % socket.gethostname(),
                      'device_owner': '%s:probe' % device_owner,
                      'tenant_id': network.tenant_id,
                      'binding:host_id': host,
                      'fixed_ips': [dict(subnet_id=s.id)
                                    for s in network.subnets]}}
     port_dict = self.client.create_port(body)['port']
     port = DictModel(port_dict)
     port.network = network
     for fixed_ip in port.fixed_ips:
         fixed_ip.subnet = self._get_subnet(fixed_ip.subnet_id)
     return port
コード例 #4
0
ファイル: debug_agent.py プロジェクト: rhel-osp/neutron
 def _create_port(self, network, device_owner):
     host = self.conf.host
     body = {
         'port': {
             'admin_state_up': True,
             'network_id': network.id,
             'device_id': '%s' % socket.gethostname(),
             'device_owner': '%s:probe' % device_owner,
             'tenant_id': network.tenant_id,
             'binding:host_id': host,
             'fixed_ips': [dict(subnet_id=s.id) for s in network.subnets]
         }
     }
     port_dict = self.client.create_port(body)['port']
     port = DictModel(port_dict)
     port.network = network
     for fixed_ip in port.fixed_ips:
         fixed_ip.subnet = self._get_subnet(fixed_ip.subnet_id)
     return port