'Get user_id and key from module configuration, environment, or dotfile.
Order of priority is module, environment, dotfile.
To set in environment:
export MCP_USER=\'myusername\'
export MCP_PASSWORD=\'mypassword\'
To set in dot file place a file at ~/.dimensiondata with
the following contents:
[dimensiondatacloud]
MCP_USER: myusername
MCP_PASSWORD: mypassword'

def get_credentials(self):

    if (not HAS_LIBCLOUD):
        self.module.fail_json(msg='libcloud    is    required    for    this    module.')
        return None
    user_id = None
    key = None
    if ('mcp_user' in self.module.params):
        if ('mcp_password' not in self.module.params):
            self.module.fail_json(msg='"mcp_user"    parameter    was    specified,    but    not    "mcp_password"    (either    both    must    be    specified,    or    neither).')
            return None
        user_id = self.module.params['mcp_user']
        key = self.module.params['mcp_password']
    if ((not user_id) or (not key)):
        user_id = os.environ.get('MCP_USER', None)
        key = os.environ.get('MCP_PASSWORD', None)
    if ((not user_id) or (not key)):
        home = expanduser('~')
        config = configparser.RawConfigParser()
        config.read(('%s/.dimensiondata' % home))
        try:
            user_id = config.get('dimensiondatacloud', 'MCP_USER')
            key = config.get('dimensiondatacloud', 'MCP_PASSWORD')
        except (configparser.NoSectionError, configparser.NoOptionError):
            pass
    if (not user_id):
        raise MissingCredentialsError('Dimension    Data    user    id    not    found')
    elif (not key):
        raise MissingCredentialsError('Dimension    Data    key    not    found')
    return dict(user_id=user_id, key=key)
