def _get_asam_configuration(driver_url=''):
    '''
    Return the configuration read from the master configuration
    file or directory
    '''
    asam_config = __opts__['asam'] if 'asam' in __opts__ else None

    if asam_config:
        try:
            for asam_server, service_config in six.iteritems(asam_config):
                username = service_config.get('username', None)
                password = service_config.get('password', None)
                protocol = service_config.get('protocol', 'https')
                port = service_config.get('port', 3451)

                if not username or not password:
                    log.error(
                        "Username or Password has not been specified in the master "
                        "configuration for {0}".format(asam_server)
                    )
                    return False

                ret = {
                    'platform_edit_url': "{0}://{1}:{2}/config/PlatformEdit.html".format(protocol, asam_server, port),
                    'platform_config_url': "{0}://{1}:{2}/config/PlatformConfig.html".format(protocol, asam_server, port),
                    'platformset_edit_url': "{0}://{1}:{2}/config/PlatformSetEdit.html".format(protocol, asam_server, port),
                    'platformset_config_url': "{0}://{1}:{2}/config/PlatformSetConfig.html".format(protocol, asam_server, port),
                    'username': username,
                    'password': password
                }

                if (not driver_url) or (driver_url == asam_server):
                    return ret
        except Exception as exc:
            log.error(
                "Exception encountered: {0}".format(exc)
            )
            return False

        if driver_url:
            log.error(
                "Configuration for {0} has not been specified in the master "
                "configuration".format(driver_url)
            )
            return False

    return False
dataset/ETHPy150Open saltstack/salt/salt/runners/asam.py/_get_asam_configuration/original