예제 #1
0
 def get_all_networks(self):
     """Get all networks for client."""
     net1 = self.network.copy()
     net2 = self.network.copy()
     net1['id'] = uuidutils.generate_uuid()
     net2['id'] = uuidutils.generate_uuid()
     return [net1, net2]
예제 #2
0
    def get_all_tenant_networks(self, tenant_id):
        net1 = self.network.copy()
        net1['tenant_id'] = tenant_id
        net1['id'] = uuidutils.generate_uuid()

        net2 = self.network.copy()
        net2['tenant_id'] = tenant_id
        net2['id'] = uuidutils.generate_uuid()
        return [net1, net2]
예제 #3
0
 def _create_share_server(self, values=None):
     if not values:
         values = {
             'share_network_id': uuidutils.generate_uuid(),
             'host': 'host1',
             'status': 'ACTIVE'
         }
     return db.share_server_create(self.ctxt, values)
예제 #4
0
 def _create_share_server(self, values=None):
     if not values:
         values = {
             'share_network_id': uuidutils.generate_uuid(),
             'host': 'host1',
             'status': 'ACTIVE'
         }
     return db.share_server_create(self.ctxt, values)
예제 #5
0
 def list_ports(self, **search_opts):
     """List ports for the client based on search options."""
     ports = []
     for i in range(2):
         ports.append(self.port.copy())
     for port in ports:
         port['id'] = uuidutils.generate_uuid()
         for key, val in search_opts.items():
             port[key] = val
         if 'id' in search_opts:
             return ports
     return ports