Retrieve the blacklist in the driver

    Retrieve the blacklist in the driver # noqa: E501

    :param driver: The driver to use for the request. ie. github
    :type driver: str

    :rtype: Response
324777
def get_driver_blacklist(driver):  # noqa: E501
    

    response = errorIfUnauthorized(role='admin')
    if response:
        return response
    else:
        response = ApitaxResponse()

    driver: Driver = LoadedDrivers.getDriver(driver)
    response.body.add({'blacklist': driver.getDriverBlacklist()})

    return Response(status=200, body=response.getResponseBody())
1023346
def _load_nexus_cfg_driver(self):
        

        try:
            loaded_class = runtime_utils.load_class_by_alias_or_classname(
                'networking_cisco.ml2.nexus_driver', 'restapi')
            return loaded_class(CONF.ml2_cisco.nexus_switches)
        except ImportError:
            LOG.error("Error loading Nexus Config driver 'restapi'")
            raise SystemExit(1)
162841
def get_black(self):
        """"""
        blacklist = []
        for read in self.black_conf.splitlines():
            read = read.lstrip()
            if not read.startswith("#"):
                blacklist.append(read.replace("\n", ""))
        return blacklist
942420
def get_driver_class(provider):
    
    if "." in provider:
        parts = provider.split('.')
        kls = parts.pop()
        path = '.'.join(parts)
        module = import_module(path)
        if not hasattr(module, kls):
            raise ImportError('{0} provider not found at {1}'.format(
                kls,
                path))
        driver = getattr(module, kls)
    else:
        driver = getattr(Provider, provider.upper())
    return get_driver(driver)
1222572
def script_catalog():  # noqa: E501
    
    if (not hasAccess()):
        return redirectUnauthorized()

    driver = LoadedDrivers.getDefaultDriver()
    return Response(status=200, body=driver.getScriptsCatalog())
1257210
def _create_driver(self, **kwargs):
        
        if self.driver is None:
            self.driver = self.create_driver(**kwargs)
            self.init_driver_func(self.driver)
291834
def _get_capabilities_from_driver_type(driver_name):
        
        if driver_name == 'firefox':
            return DesiredCapabilities.FIREFOX.copy()
        elif driver_name == 'chrome':
            return DesiredCapabilities.CHROME.copy()
        elif driver_name == 'safari':
            return DesiredCapabilities.SAFARI.copy()
        elif driver_name == 'opera':
            return DesiredCapabilities.OPERA.copy()
        elif driver_name == 'iexplore':
            return DesiredCapabilities.INTERNETEXPLORER.copy()
        elif driver_name == 'edge':
            return DesiredCapabilities.EDGE.copy()
        elif driver_name == 'phantomjs':
            return DesiredCapabilities.PHANTOMJS.copy()
        elif driver_name in ('android', 'ios', 'iphone'):
            return {}
        raise Exception('Unknown driver {0}'.format(driver_name))
1067166
def get_link_driver(uri, link_quality_callback=None, link_error_callback=None):
    """"""
    for driverClass in CLASSES:
        try:
            instance = driverClass()
            instance.connect(uri, link_quality_callback, link_error_callback)
            return instance
        except WrongUriType:
            continue

    return None
698681
def firmware_drivers(self):
        
        if not self.__firmware_drivers:
            self.__firmware_drivers = FirmwareDrivers(self.__connection)
        return self.__firmware_drivers
86367
def _get_peer_connection(self, blacklist=None):
        

        blacklist = blacklist or set()

        peer = None
        connection = None

        while connection is None:
            peer = self._choose(blacklist)

            if not peer:
                raise NoAvailablePeerError(
                    "Can't find an available peer for '%s'" % self.service
                )

            try:
                connection = yield peer.connect()
            except NetworkError as e:
                log.info(
                    'Failed to connect to %s. Trying a different host.',
                    peer.hostport,
                    exc_info=e,
                )
                connection = None
                blacklist.add(peer.hostport)

        raise gen.Return((peer, connection))
1042343
def get_user(user, driver):  # noqa: E501
    

    response = ApitaxResponse()

    driver: Driver = LoadedDrivers.getDriver(driver)
    user: User = driver.getApitaxUser(User(username=user))
    response.body.add({'user': {'username': user.username, 'role': user.role}})

    return Response(status=200, body=response.getResponseBody())
1217402
def get_driver(secret_key=config.DEFAULT_SECRET_KEY, userid=config.DEFAULT_USERID,
               provider=config.DEFAULT_PROVIDER):

    """"""

    if hasattr(config, 'get_driver'):
        logger.debug('get_driver %s' % config.get_driver)
        return config.get_driver()
    else:
        logger.debug('get_driver {0}@{1}'.format(userid, provider))
        return libcloud.compute.providers.get_driver(
            config.PROVIDERS[provider])(userid, secret_key)
1027561
def should_not_sample_route(request):
    
    blacklisted_routes = request.registry.settings.get(
        'zipkin.blacklisted_routes', [])

    if not blacklisted_routes:
        return False
    route_mapper = request.registry.queryUtility(IRoutesMapper)
    route_info = route_mapper(request).get('route')
    return (route_info and route_info.name in blacklisted_routes)
106296
def get_driver_config(driver):  # noqa: E501
    

    response = errorIfUnauthorized(role='admin')
    if response:
        return response
    else:
        response = ApitaxResponse()

    # TODO: This needs an implementation, but likely requires a change to configs in apitaxcore

    return Response(status=200, body=response.getResponseBody())
1159316
def get_hosting_device_plugging_driver(self, context, id):
        """"""
        if id is None:
            return
        try:
            return self._plugging_drivers[id]
        except KeyError:
            try:
                template = self._get_hosting_device_template(context, id)
                self._plugging_drivers[id] = importutils.import_object(
                    template['plugging_driver'])
            except (ImportError, TypeError, n_exc.NeutronException):
                LOG.exception("Error loading plugging driver for hosting "
                              "device template %s", id)
            return self._plugging_drivers.get(id)
1231188
def create_driver_script(name, create=None):  # noqa: E501
    
    if connexion.request.is_json:
        create = Create1.from_dict(connexion.request.get_json())  # noqa: E501

    response = errorIfUnauthorized(role='developer')
    if response:
        return response
    else:
        response = ApitaxResponse()

    driver: Driver = LoadedDrivers.getDriver(name)
    driver.saveDriverScript(create.script.name, create.script.content)

    return Response(status=200, body=response.getResponseBody())
633199
def set_blacklisted_plugins(self, plugins):
        
        plugins = util.return_list(plugins)
        self.blacklisted_plugins = plugins