Reboot a node.

    CLI Example:

    .. code-block:: bash

        salt-cloud -a reboot mymachine
16565
def reboot(name, call=None):
    '''
    
    '''
    instance_id = _get_node(name)['instanceId']
    params = {'Action': 'RebootInstances',
              'InstanceId.1': instance_id}

    result = aws.query(params,
                       setname='tagSet',
                       location=get_location(),
                       provider=get_provider(),
                       opts=__opts__,
                       sigver='4')

    if result == []:
        log.info('Complete')

    return {'Reboot': 'Complete'}
1108193
def salt_ssh():
    '''
    
    '''
    import salt.cli.ssh
    if '' in sys.path:
        sys.path.remove('')
    try:
        client = salt.cli.ssh.SaltSSH()
        _install_signal_handlers(client)
        client.run()
    except SaltClientError as err:
        trace = traceback.format_exc()
        try:
            hardcrash = client.options.hard_crash
        except (AttributeError, KeyError):
            hardcrash = False
        _handle_interrupt(
            SystemExit(err),
            err,
            hardcrash, trace=trace)
868673
def restart_cluster(name):
    '''
    

    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    if __opts__['test']:
        ret['comment'] = 'Restarting cluster'
        return ret

    __salt__['trafficserver.restart_cluster']()

    ret['result'] = True
    ret['comment'] = 'Restarted cluster'
    return ret
1361972
def reboot(self, comment=None):
        
        self.make_request(
            NodeCommandFailed,
            method='update',
            resource='reboot',
            params={'comment': comment})
1298845
def reboot_adb_server():
    
    _reboot_count = 0
    _max_retry = 1

    def _reboot():
        nonlocal _reboot_count
        if _reboot_count >= _max_retry:
            raise RuntimeError('fail after retry {} times'.format(_max_retry))
        _reboot_count += 1

        return_code = subprocess.call(['adb', 'devices'], stdout=subprocess.DEVNULL)
        if bool(return_code):
            warnings.warn('return not zero, execute "adb version" failed')
            raise EnvironmentError('adb did not work :(')

    return _reboot
680159
def reload_():
    '''
    
    '''

    ret = {'comment': [],
           'result': True}

    # If there a schedule defined in pillar, refresh it.
    if 'schedule' in __pillar__:
        out = __salt__['event.fire']({}, 'pillar_refresh')
        if out:
            ret['comment'].append('Reloaded schedule from pillar on minion.')
        else:
            ret['comment'].append('Failed to reload schedule from pillar on minion.')
            ret['result'] = False

    # move this file into an configurable opt
    sfn = '{0}/{1}/schedule.conf'.format(__opts__['config_dir'], os.path.dirname(__opts__['default_include']))
    if os.path.isfile(sfn):
        with salt.utils.files.fopen(sfn, 'rb') as fp_:
            try:
                schedule = salt.utils.yaml.safe_load(fp_)
            except salt.utils.yaml.YAMLError as exc:
                ret['comment'].append('Unable to read existing schedule file: {0}'.format(exc))

        if schedule:
            if 'schedule' in schedule and schedule['schedule']:
                out = __salt__['event.fire']({'func': 'reload', 'schedule': schedule}, 'manage_schedule')
                if out:
                    ret['comment'].append('Reloaded schedule on minion from schedule.conf.')
                else:
                    ret['comment'].append('Failed to reload schedule on minion from schedule.conf.')
                    ret['result'] = False
            else:
                ret['comment'].append('Failed to reload schedule on minion.  Saved file is empty or invalid.')
                ret['result'] = False
        else:
            ret['comment'].append('Failed to reload schedule on minion.  Saved file is empty or invalid.')
            ret['result'] = False
    return ret
518326
def reboot(name, call=None, session=None):
    '''
    

    '''
    if call == 'function':
        raise SaltCloudException(
            'The show_instnce function must be called with -a or --action.'
        )
    if session is None:
        session = _get_session()
    log.info('Starting VM %s', name)
    vm = _get_vm(name, session)
    power_state = session.xenapi.VM.get_power_state(vm)
    if power_state == 'Running':
        task = session.xenapi.Async.VM.clean_reboot(vm)
        _run_async_task(task, session)
        return show_instance(name)
    else:
        return '{} is not running to be rebooted'.format(name)
1317117
def reboot(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The stop action must be called with -a or --action.'
        )

    log.info('Rebooting node %s', name)

    instance_id = _get_node(name)['InstanceId']

    params = {'Action': 'RebootInstance',
              'InstanceId': instance_id}
    result = query(params)

    return result
241909
def reload(self, reload_timeout, save_config):
        """"""
        PROCEED = re.compile(re.escape("Proceed with reload? [confirm]"))
        CONTINUE = re.compile(re.escape("Do you wish to continue?[confirm(y/n)]"))
        DONE = re.compile(re.escape("[Done]"))
        CONFIGURATION_COMPLETED = re.compile("SYSTEM CONFIGURATION COMPLETED")
        CONFIGURATION_IN_PROCESS = re.compile("SYSTEM CONFIGURATION IN PROCESS")

        # CONSOLE = re.compile("ios con[0|1]/RS?P[0-1]/CPU0 is now available")
        CONSOLE = re.compile("con[0|1]/(?:RS?P)?[0-1]/CPU0 is now available")
        CONSOLE_STBY = re.compile("con[0|1]/(?:RS?P)?[0-1]/CPU0 is in standby")
        RECONFIGURE_USERNAME_PROMPT = "[Nn][Oo] root-system username is configured"
        ROOT_USERNAME_PROMPT = "Enter root-system username\: "
        ROOT_PASSWORD_PROMPT = "Enter secret( again)?\: "

        # BOOT=disk0:asr9k-os-mbi-6.1.1/0x100305/mbiasr9k-rsp3.vm,1; \
        # disk0:asr9k-os-mbi-5.3.4/0x100305/mbiasr9k-rsp3.vm,2;
        # Candidate Boot Image num 0 is disk0:asr9k-os-mbi-6.1.1/0x100305/mbiasr9k-rsp3.vm
        # Candidate Boot Image num 1 is disk0:asr9k-os-mbi-5.3.4/0x100305/mbiasr9k-rsp3.vm
        CANDIDATE_BOOT_IMAGE = "Candidate Boot Image num 0 is .*vm"
        NOT_COMMITTED = re.compile(re.escape("Some active software packages are not yet committed. Proceed?[confirm]"))
        RELOAD_NA = re.compile("Reload to the ROM monitor disallowed from a telnet line")
        #           0          1      2                3                   4                  5
        events = [RELOAD_NA, DONE, PROCEED, CONFIGURATION_IN_PROCESS, self.rommon_re, self.press_return_re,
                  #   6               7                   8                           9
                  CONSOLE, CONFIGURATION_COMPLETED, RECONFIGURE_USERNAME_PROMPT, ROOT_USERNAME_PROMPT,
                  #    10                    11              12     13          14           15
                  ROOT_PASSWORD_PROMPT, self.username_re, TIMEOUT, EOF, self.reload_cmd, CANDIDATE_BOOT_IMAGE,
                  #   16            17
                  NOT_COMMITTED, CONSOLE_STBY, CONTINUE]

        transitions = [
            (RELOAD_NA, [0], -1, a_reload_na, 0),
            (CONTINUE, [0], 0, partial(a_send, "y\r"), 0),
            # temp for testing
            (NOT_COMMITTED, [0], -1, a_not_committed, 10),
            (DONE, [0], 2, None, 120),
            (PROCEED, [2], 3, partial(a_send, "\r"), reload_timeout),
            # this needs to be verified
            (self.rommon_re, [0, 3], 3, partial(a_send_boot, "boot"), 600),
            (CANDIDATE_BOOT_IMAGE, [0, 3], 4, a_message_callback, 600),
            (CONSOLE, [0, 1, 3, 4], 5, None, 600),
            # This is required. Otherwise nothing more is displayed on the console
            (self.press_return_re, [5], 6, partial(a_send, "\r"), 300),
            # configure root username and password the same as used for device connection.
            (RECONFIGURE_USERNAME_PROMPT, [6, 7, 10], 8, None, 10),
            (ROOT_USERNAME_PROMPT, [8], 9, partial(a_send_username, self.device.node_info.username), 1),
            (ROOT_PASSWORD_PROMPT, [9], 9, partial(a_send_password, self.device.node_info.password), 1),
            (CONFIGURATION_IN_PROCESS, [6, 9], 10, None, 1200),
            (CONFIGURATION_COMPLETED, [10], -1, a_reconnect, 0),
            (CONSOLE_STBY, [4], -1, ConnectionStandbyConsole("Standby Console"), 0),
            (self.username_re, [7, 9], -1, a_return_and_reconnect, 0),
            (TIMEOUT, [0, 1, 2], -1, ConnectionAuthenticationError("Unable to reload"), 0),
            (EOF, [0, 1, 2, 3, 4, 5], -1, ConnectionError("Device disconnected"), 0),
            (TIMEOUT, [6], 7, partial(a_send, "\r"), 180),
            (TIMEOUT, [7], -1, ConnectionAuthenticationError("Unable to reconnect after reloading"), 0),
            (TIMEOUT, [10], -1, a_reconnect, 0),

        ]

        fsm = FSM("RELOAD", self.device, events, transitions, timeout=600)
        return fsm.run()
942731
def refresh_db(**kwargs):
    '''
    
    '''
    # Remove rtag file to keep multiple refreshes from happening in pkg states
    salt.utils.pkg.clear_rtag(__opts__)
    cmd = ['port', 'selfupdate']
    return salt.utils.mac_utils.execute_return_success(cmd)
708662
def start(name):
    '''
    
    '''
    ret = {}
    cmd = '{0} startvm {1}'.format(vboxcmd(), name)
    ret = salt.modules.cmdmod.run(cmd).splitlines()
    return ret
1222915
def restart(self, timeout=None, task=None, block_callbacks=False, role=None):
        
        self.set_state('restarting')
        if not block_callbacks:
            self.__cb_pending = ACTION_ON_RESTART
        ret = self.stop(block_callbacks=True) and self.start(timeout, task, True, role)
        if not ret and not self.is_starting():
            self.set_state('restart failed ({0})'.format(self.state))
        return ret
1167023
function rebootHandler(job) {
   // Check if the reboot job has not yet been initiated
   if (job.status.status === 'QUEUED' || 
       isUndefined(job.status.statusDetails) || 
       isUndefined(job.status.statusDetails.step)) {

      // Change status to IN_PROGRESS
      job.inProgress({ operation: job.operation, step: 'initiated' }, function(err) { 
         showJobsError(err);

         var delay = (isUndefined(job.document.delay) ? '0' : job.document.delay.toString());

         // User account running node.js agent must have passwordless sudo access on /sbin/shutdown
         // Recommended online search for permissions setup instructions https://www.google.com/search?q=passwordless+sudo+access+instructions
         exec('sudo /sbin/shutdown -r +' + delay, function (err) { 
            if (!isUndefined(err)) {
               job.failed({ operation: job.operation, errorCode: 'ERR_SYSTEM_CALL_FAILED', errorMessage: 'unable to execute reboot, check passwordless sudo permissions on agent', 
                            error: errorToString(err) }, showJobsError);
            }
         });
      });

   // Check if the reboot operation has already been successfully initiated
   } else if (job.status.statusDetails.step === 'initiated') {
      job.succeeded({ operation: job.operation, step: 'rebooted' }, showJobsError);
   } else {
      job.failed({ operation: job.operation, errorCode: 'ERR_UNEXPECTED', errorMessage: 'reboot job execution in unexpected state' }, showJobsError);
   }   
}
680226
def reboot(self, uuid):
        
        args = {
            'uuid': uuid,
        }
        self._domain_action_chk.check(args)

        self._client.sync('kvm.reboot', args)
571532
def salt_call():
    '''
    
    '''
    import salt.cli.call
    if '' in sys.path:
        sys.path.remove('')
    client = salt.cli.call.SaltCall()
    _install_signal_handlers(client)
    client.run()
617535
def reboot(self):
        
        print '%s call reboot' % self.port
        try:
            self._sendline(WPANCTL_CMD + 'reset')
            self.isPowerDown = True


            if self.__sendCommand(WPANCTL_CMD + 'getprop -v NCP:State')[0] != 'associated':
                print '[FAIL] reboot'
                return False
            else:
                return True
        except Exception, e:
            ModuleHelper.WriteIntoDebugLogger('reboot() Error: ' + str(e))
234607
def cmd_reboot(self, args):
        ''''''
        if len(args) > 0 and args[0] == 'bootloader':
            self.master.reboot_autopilot(True)
        else:
            self.master.reboot_autopilot()