~james-page/ubuntu/vivid/neutron-lbaas/2015.1.b3

« back to all changes in this revision

Viewing changes to neutron_lbaas/services/loadbalancer/agent/agent_manager.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-02-16 09:24:28 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20150216092428-xj2eg6134f65core
Tags: 1:2015.1~b2-0ubuntu1
* New upstream release.
  - d/control: Update/align with upstream dependency changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#    License for the specific language governing permissions and limitations
13
13
#    under the License.
14
14
 
15
 
from oslo.config import cfg
16
 
from oslo import messaging
17
 
from oslo.utils import importutils
18
 
 
19
15
from neutron.agent import rpc as agent_rpc
20
16
from neutron.common import constants as n_const
21
17
from neutron.common import exceptions as n_exc
26
22
from neutron.openstack.common import loopingcall
27
23
from neutron.openstack.common import periodic_task
28
24
from neutron.plugins.common import constants
 
25
from neutron.services import provider_configuration as provconfig
 
26
from oslo_config import cfg
 
27
import oslo_messaging
 
28
from oslo_utils import importutils
 
29
 
29
30
from neutron_lbaas.services.loadbalancer.agent import agent_api
30
31
 
31
32
LOG = logging.getLogger(__name__)
32
33
 
 
34
DEVICE_DRIVERS = 'device_drivers'
 
35
 
33
36
OPTS = [
34
37
    cfg.MultiStrOpt(
35
38
        'device_driver',
53
56
    #       - modify/reload/destroy_pool methods were removed;
54
57
    #       - added methods to handle create/update/delete for every lbaas
55
58
    #       object individually;
56
 
    target = messaging.Target(version='2.0')
 
59
    target = oslo_messaging.Target(version='2.0')
57
60
 
58
61
    def __init__(self, conf):
59
62
        super(LbaasAgentManager, self).__init__()
83
86
    def _load_drivers(self):
84
87
        self.device_drivers = {}
85
88
        for driver in self.conf.device_driver:
 
89
            driver = provconfig.get_provider_driver_class(driver,
 
90
                                                          DEVICE_DRIVERS)
86
91
            try:
87
92
                driver_inst = importutils.import_object(
88
93
                    driver,
186
191
    def _destroy_pool(self, pool_id):
187
192
        driver = self._get_driver(pool_id)
188
193
        try:
189
 
            driver.undeploy_instance(pool_id)
 
194
            driver.undeploy_instance(pool_id, delete_namespace=True)
190
195
            del self.instance_mapping[pool_id]
191
196
            self.plugin_rpc.pool_destroyed(pool_id)
192
197
        except Exception: