Exemplo n.º 1
0
def load_drivers(conf):
    """Imports all the driver files corresponding to this agent.

    Returns: Dictionary of driver objects with a specified service type and
    vendor name

    """

    ld = load_driver.ConfiguratorUtils(conf)
    drivers = ld.load_drivers(const.SERVICE_TYPE)

    for service_type, driver_name in drivers.iteritems():
        driver_obj = driver_name(conf=conf)
        drivers[service_type] = driver_obj

    return drivers
Exemplo n.º 2
0
def get_configurator_module_instance(sc, conf):
    """ Provides ConfiguratorModule class object and loads service agents.

    Returns: Instance of ConfiguratorModule class

    """

    cm = ConfiguratorModule(sc)
    conf_utils = utils.ConfiguratorUtils(conf)

    # Loads all the service agents under AGENT_PKG module path
    cm.imported_sas = conf_utils.load_agents(const.AGENTS_PKG)
    msg = ("Configurator loaded service agents from %s location."
           % (cm.imported_sas))
    LOG.info(msg)
    return cm
Exemplo n.º 3
0
def load_drivers(conf):
    """Imports all the driver files.

    Returns: Dictionary of driver objects with a specified service type and
    vendor name

    """

    cutils = utils.ConfiguratorUtils(conf)
    drivers = cutils.load_drivers()

    for service_type, driver_name in drivers.iteritems():
        driver_obj = driver_name(conf=conf)
        drivers[service_type] = driver_obj

    return drivers
def load_drivers(conf):
    """Imports all the driver files.

    Returns: Dictionary of driver objects with a specified service type and
    vendor name

    """

    cutils = utils.ConfiguratorUtils(conf)
    drivers = cutils.load_drivers()

    for service_type, driver_name in six.iteritems(drivers):
        driver_obj = driver_name(conf=conf)
        drivers[service_type] = driver_obj
    LOG.info("Generic config agent loaded drivers drivers:"
             "%(drivers)s", {'drivers': drivers})
    return drivers
Exemplo n.º 5
0
def load_drivers(conf):
    """Imports all the driver files corresponding to this agent.

    Returns: Dictionary of driver objects with a specified service type and
    vendor name

    """

    ld = load_driver.ConfiguratorUtils(conf)
    drivers = ld.load_drivers(const.SERVICE_TYPE)

    for service_type, driver_name in six.iteritems(drivers):
        driver_obj = driver_name(conf=conf)
        drivers[service_type] = driver_obj

    LOG.info(_LI("Firewall loaded drivers:%(drivers)s"), {'drivers': drivers})
    return drivers
def load_drivers(sc, conf):
    """Imports all the driver files.

    Returns: Dictionary of driver objects with a specified service type and/or
    vendor name

    """
    cutils = utils.ConfiguratorUtils(conf)
    drivers = cutils.load_drivers(lb_const.SERVICE_TYPE)

    plugin_rpc = LBaaSV2RpcSender(sc)

    for service_type, dobj in six.iteritems(drivers):
        '''LB Driver constructor needs plugin_rpc as a param'''
        instantiated_dobj = dobj(plugin_rpc=plugin_rpc, conf=conf)
        drivers[service_type] = instantiated_dobj

    return drivers
Exemplo n.º 7
0
def load_drivers(sc, conf):
    """Loads the drivers dynamically.

    Loads the drivers that register with the agents.
    :param sc: Object of the Service Controller class from core
    service controller.

    Returns: dictionary of instances of the respective driver classes.
    """

    ld = utils.ConfiguratorUtils(conf)
    drivers = ld.load_drivers(const.SERVICE_TYPE)

    for service_type, driver_name in six.iteritems(drivers):
        driver_obj = driver_name(conf=conf)
        drivers[service_type] = driver_obj

    return drivers