<commit_before># -*- coding: utf-8 -*-
'''
Module for interop with the Splunk API

.. versionadded:: Boron.


:depends:   - splunk-sdk python module
:configuration: Configure this module by specifying the name of a configuration
    profile in the minion config, minion pillar, or master config. The module
    will use the 'splunk' key by default, if defined.

    For example:

    .. code-block:: yaml

        splunk:
            username: alice
            password: <PASSWORD>
            host: example.splunkcloud.com
            port: 8080
'''
from __future__ import absolute_import

# Import python libs
import logging
import hmac
import base64
import subprocess

# Import third party libs
HAS_LIBS = False
try:
    import splunklib.client
    from splunklib.client import AuthenticationError
    from splunklib.binding import HTTPError
    HAS_LIBS = True
except ImportError:
    pass

log = logging.getLogger(__name__)

__virtualname__ = 'splunk'

SERVICE_NAME = "splunk"

ALLOWED_FIELDS_FOR_MODIFICATION = [
    'realname',
    'roles',
    'defaultApp',
    'tz',
    #'capabilities',
    'name'
]

REQUIRED_FIELDS_FOR_CREATE = [
    'realname',
    'name',
    'roles'
]


def __virtual__():
    '''
    Only load this module if splunk is installed on this minion.
    '''
    if HAS_LIBS:
        return __virtualname__
    return False

<commit_msg>modules.splunk: __virtual__ return err msg.<commit_after># -*- coding: utf-8 -*-
'''
Module for interop with the Splunk API

.. versionadded:: Boron.


:depends:   - splunk-sdk python module
:configuration: Configure this module by specifying the name of a configuration
    profile in the minion config, minion pillar, or master config. The module
    will use the 'splunk' key by default, if defined.

    For example:

    .. code-block:: yaml

        splunk:
            username: alice
            password: <PASSWORD>
            host: example.splunkcloud.com
            port: 8080
'''
from __future__ import absolute_import

# Import python libs
import logging
import hmac
import base64
import subprocess

# Import third party libs
HAS_LIBS = False
try:
    import splunklib.client
    from splunklib.client import AuthenticationError
    from splunklib.binding import HTTPError
    HAS_LIBS = True
except ImportError:
    pass

log = logging.getLogger(__name__)

__virtualname__ = 'splunk'

SERVICE_NAME = "splunk"

ALLOWED_FIELDS_FOR_MODIFICATION = [
    'realname',
    'roles',
    'defaultApp',
    'tz',
    #'capabilities',
    'name'
]

REQUIRED_FIELDS_FOR_CREATE = [
    'realname',
    'name',
    'roles'
]


def __virtual__():
    '''
    Only load this module if splunk is installed on this minion.
    '''
    if HAS_LIBS:
        return __virtualname__
    return (False, 'The splunk execution module failed to load: '
            'requires splunk python library to be installed.')


{'fraction_non_alphanumeric': 0.08286908077994429, 'fraction_numerical': 0.004874651810584958, 'mean_word_length': 2.8876860622462788, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1269687', 'n_tokens_mistral': 902, 'n_tokens_neox': 877, 'n_words': 286}