예제 #1
0
def _get_storedcredentials(module, kwargs):
    result = None
    try:
        with connection_object(module, kwargs) as con:
            result = storedcredentials(con, kwargs.get('storedcredential_id'))
    except Exception as err:
        disconnect()
        module.fail_json(msg="Error getting stored credential " + str(err))
    return result
예제 #2
0
def _delete_storedcredentials(module, kwargs):
    global __changed__
    result = None
    try:
        with connection_object(module, kwargs) as con:
            result = storedcredentials(
                con, delete_id=kwargs.get('storedcredential_id'))
            __changed__ = True
    except Exception as err:
        module.fail_json(msg="Error getting stored credential " + str(err))
    return result
def _create_storedcredentials(module, kwargs):
    global __changed__
    result = None
    try:
        with connection_object(module, kwargs) as con:
            result = storedcredentials(con,
                                       user_name=kwargs.get('user'),
                                       password=kwargs.get('password'),
                                       description=kwargs.get('description'),)
            __changed__ = True
    except Exception as err:
        module.fail_json(msg="Error create stored credential " + str(err))
    return result