def take_action(name=None, call=None, command=None, data=None, method='GET',
                location=DEFAULT_LOCATION):
    caller = inspect.stack()[1][3]

    if call != 'action':
        raise SaltCloudSystemExit(
            'This action must be called with -a or --action.'
        )

    if data:
        data = json.dumps(data)

    ret = []
    try:

        ret = query(command=command, data=data, method=method,
                     location=location)
        log.info('Success {0} for node {1}'.format(caller, name))
    except Exception as exc:
        if 'InvalidState' in str(exc):
            ret = [200, {}]
        else:
            log.error(
                'Failed to invoke {0} node {1}: {2}'.format(caller, name, exc),
                # Show the traceback if the debug logging level is enabled
                exc_info_on_loglevel=logging.DEBUG
            )
            ret = [100, {}]

    return ret
Spawns new NSThread to handle notifications.
dataset/ETHPy150Open saltstack/salt/salt/cloud/clouds/joyent.py/take_action--crossover with--dataset/ETHPy150Open Kentzo/Power/power/darwin.py/PowerSourcesNotificationsObserver.startThread