Exemplo n.º 1
0
 def get_network(self, context, id, fields=None):
     flavor = meta_db_v2.get_flavor_by_network(id)
     plugin = self._get_plugin(flavor)
     net = plugin.get_network(context, id, fields)
     if not fields or FLAVOR_NETWORK in fields:
         self._extend_network_dict(context, net)
     return net
Exemplo n.º 2
0
 def get_network(self, context, id, fields=None):
     flavor = meta_db_v2.get_flavor_by_network(id)
     plugin = self._get_plugin(flavor)
     net = plugin.get_network(context, id, fields)
     if not fields or 'flavor:id' in fields:
         self._extend_network_dict(context, net)
     return net
Exemplo n.º 3
0
 def update_network(self, context, id, network):
     flavor = meta_db_v2.get_flavor_by_network(context.session, id)
     plugin = self._get_plugin(flavor)
     with context.session.begin(subtransactions=True):
         net = plugin.update_network(context, id, network)
         if not self._is_l3_plugin(plugin):
             self._process_l3_update(context, network["network"], id)
             self._extend_network_dict_l3(context, net)
     return net
 def update_network(self, context, id, network):
     flavor = meta_db_v2.get_flavor_by_network(context.session, id)
     plugin = self._get_plugin(flavor)
     with context.session.begin(subtransactions=True):
         net = plugin.update_network(context, id, network)
         if not self._is_l3_plugin(plugin):
             self._process_l3_update(context, network['network'], id)
             self._extend_network_dict_l3(context, net)
     return net
Exemplo n.º 5
0
 def get_network(self, context, id, fields=None):
     flavor = meta_db_v2.get_flavor_by_network(context.session, id)
     plugin = self._get_plugin(flavor)
     net = plugin.get_network(context, id, fields)
     net["id"] = id
     if not fields or "router:external" in fields:
         self._extend_network_dict_l3(context, net)
     if not fields or FLAVOR_NETWORK in fields:
         self._extend_network_dict(context, net)
     if fields and not "id" in fields:
         del net["id"]
     return net
 def get_network(self, context, id, fields=None):
     flavor = meta_db_v2.get_flavor_by_network(context.session, id)
     plugin = self._get_plugin(flavor)
     net = plugin.get_network(context, id, fields)
     net['id'] = id
     if not fields or 'router:external' in fields:
         self._extend_network_dict_l3(context, net)
     if not fields or FLAVOR_NETWORK in fields:
         self._extend_network_dict(context, net)
     if fields and 'id' not in fields:
         del net['id']
     return net
Exemplo n.º 7
0
 def _get_flavor_by_network_id(self, network_id):
     return meta_db_v2.get_flavor_by_network(network_id)
Exemplo n.º 8
0
 def delete_network(self, context, id):
     flavor = meta_db_v2.get_flavor_by_network(id)
     plugin = self._get_plugin(flavor)
     return plugin.delete_network(context, id)
Exemplo n.º 9
0
 def _get_flavor_by_network_id(self, context, network_id):
     return meta_db_v2.get_flavor_by_network(context.session, network_id)
Exemplo n.º 10
0
 def _get_flavor_by_network_id(self, context, network_id):
     return meta_db_v2.get_flavor_by_network(context.session, network_id)
Exemplo n.º 11
0
 def delete_network(self, context, id):
     flavor = meta_db_v2.get_flavor_by_network(context.session, id)
     plugin = self._get_plugin(flavor)
     return plugin.delete_network(context, id)
Exemplo n.º 12
0
 def _get_flavor_by_network_id(self, network_id):
     return meta_db_v2.get_flavor_by_network(network_id)