Emits a warning if Drupal VM is initialized but not running.
184710
protected function warnIfDrupalVmNotRunning() {
    if (!$this->isVmCli() && $this->isDrupalVmLocallyInitialized() && !$this->isDrupalVmBooted()) {
      $this->logger->warning("Drupal VM is locally initialized, but is not running.");
    }
  }
1201076
def __IsInitialized(self):      
      
    is_initialized = False
    iam_id = self.GetAccessKeyId()
    if iam_id:
      if core.CirrusAccessIdMetadata(self.s3, iam_id).IsInitialized():
        is_initialized = True
    return is_initialized
1008672
@Override
    public void postInitModule() throws ModuleInitializationException {
        ConnectionPoolManager mgr =
                (ConnectionPoolManager) getServer()
                        .getModule("org.fcrepo.server.storage.ConnectionPoolManager");
        if (mgr == null) {
            throw new ModuleInitializationException("ConnectionPoolManager module not loaded.",
                                                    getRole());
        }
        try {
            m_pidGenerator = new DBPIDGenerator(mgr.getPool(), m_oldPidGenDir);
        } catch (Exception e) {
            String msg = "Can't get default connection pool";
            logger.error(msg, e);
            throw new ModuleInitializationException(msg, getRole());
        }
    }
1222054
def _find_init_change(name, ret, **kwargs):
    '''
    
    '''
    kwargs = salt.utils.args.clean_kwargs(**kwargs)
    if 'vm' in kwargs:
        kwargs.update(kwargs.pop('vm'))
    # the state processing eats 'runas' so we rename
    kwargs['runas'] = kwargs.pop('vagrant_runas', '')
    try:
        vm_ = __salt__['vagrant.get_vm_info'](name)
    except SaltInvocationError:
        vm_ = {}
        for key, value in kwargs.items():
            ret['changes'][key] = {'old': None, 'new': value}
    if vm_:  # test for changed values
        for key in vm_:
            value = vm_[key] or ''  # supply a blank if value is None
            if key != 'name':  # will be missing in kwargs
                new = kwargs.get(key, '')
                if new != value:
                    if key == 'machine' and new == '':
                        continue  # we don't know the default machine name
                    ret['changes'][key] = {'old': value, 'new': new}
    return ret, kwargs
863380
private synchronized void checkInitialization() throws DevFailed {
        if (initImpl != null) {
            isInitializing = initImpl.isInitInProgress();
        } else {
            isInitializing = false;
        }
        if (isInitializing) {
            throw DevFailedUtils.newDevFailed("CONCURRENT_ERROR", name + " in Init command ");
        }
    }
363541
def pwarning(*args, **kwargs):
    """"""
    if should_msg(kwargs.get("groups", ["warning"])):

        # initialize colorama only if uninitialized
        global colorama_init
        if not colorama_init:
            colorama_init = True
            colorama.init()

        args = indent_text(*args, **kwargs)

        # write to stdout
        sys.stderr.write(colorama.Fore.YELLOW)
        sys.stderr.write("".join(args))
        sys.stderr.write(colorama.Fore.RESET)
        sys.stderr.write("\n")
910203
function initModule(modName, mod) {
        console.log("Initialising "+modName);
        if (mod.init !== undefined)
          mod.init();
      }
266145
private void initServerHandle(Configuration pConfig, LogHandler pLogHandler, List<ServerDetector> pDetectors) {
        serverHandle = detectServers(pDetectors, pLogHandler);
        if (serverHandle != null) {
            serverHandle.postDetect(mBeanServerManager, pConfig, pLogHandler);
        }
    }
249290
def init():
    """"""
    if not os.path.isdir('venv'):
        print(cyan('\nCreating the virtual env...'))

        local('pyvenv-3.4 venv')

        print(green('Virtual env created.'))

    print(green('Virtual Environment ready.'))
1188140
def shutdown(vm_):
    '''
    
    '''
    with _get_xapi_session() as xapi:
        vm_uuid = _get_label_uuid(xapi, 'VM', vm_)
        if vm_uuid is False:
            return False
        try:
            xapi.VM.clean_shutdown(vm_uuid)
            return True
        except Exception:
            return False
85867
def guest_start(self, userid):
        """""""
        LOG.info("Begin to power on vm %s", userid)
        self._smtclient.guest_start(userid)
        LOG.info("Complete power on vm %s", userid)
1176390
def init(venv_name):
    """"""
    inenv = InenvManager()
    inenv.get_prepped_venv(venv_name, skip_cached=False)
    if not os.getenv(INENV_ENV_VAR):
        activator_warn(inenv)
    click.secho("Your venv is ready. Enjoy!", fg='green')
601214
function(){
		if(shuttingDown == true)
			return;
		modules.logger.log("startup","ISNode System > Loading Critical Modules...");
		var notLoadedString = "";
		loadModule("isnode-mod-utilities");
		if(!modules.utilities)
			notLoadedString += "utilities, ";
		if(notLoadedString != ""){
			notLoadedString = notLoadedString.substring(0, notLoadedString.length - 2);
			modules.logger.log("fatal","ISNode System > Unable to load critical isnode modules - " + notLoadedString + ". Exiting isnode.");
			process.exit();
			return false;
		}
		return true;
	}
387171
private void serverInventoryInitialized()
  {
    long start = System.currentTimeMillis();
    long serverSyncWaitTimeout = config.getServerTimeout() + 2 * ChangeRequestHttpSyncer.HTTP_TIMEOUT_EXTRA_MS;

    List<DruidServerHolder> uninitializedServers = new ArrayList<>();
    for (DruidServerHolder server : servers.values()) {
      if (!server.isSyncedSuccessfullyAtleastOnce()) {
        uninitializedServers.add(server);
      }
    }

    while (!uninitializedServers.isEmpty() && ((System.currentTimeMillis() - start) < serverSyncWaitTimeout)) {
      try {
        Thread.sleep(5000);
      }
      catch (InterruptedException ex) {
        throw new RE(ex, "Interrupted while waiting for queryable server initial successful sync.");
      }

      log.info("Checking whether all servers have been synced at least once yet....");
      Iterator<DruidServerHolder> iter = uninitializedServers.iterator();
      while (iter.hasNext()) {
        if (iter.next().isSyncedSuccessfullyAtleastOnce()) {
          iter.remove();
        }
      }
    }

    if (uninitializedServers.isEmpty()) {
      log.info("All servers have been synced successfully at least once.");
    } else {
      for (DruidServerHolder server : uninitializedServers) {
        log.warn(
            "Server[%s] might not yet be synced successfully. We will continue to retry that in the background.",
            server.druidServer.getName()
        );
      }
    }

    log.info("Calling SegmentCallback.segmentViewInitialized() for all callbacks.");

    runSegmentCallbacks(
        new Function<SegmentCallback, CallbackAction>()
        {
          @Override
          public CallbackAction apply(SegmentCallback input)
          {
            return input.segmentViewInitialized();
          }
        }
    );
  }
974232
def wait_for_state(vmid, state, timeout=300):
    '''
    
    '''
    start_time = time.time()
    node = get_vm_status(vmid=vmid)
    if not node:
        log.error('wait_for_state: No VM retrieved based on given criteria.')
        raise SaltCloudExecutionFailure

    while True:
        if node['status'] == state:
            log.debug('Host %s is now in "%s" state!', node['name'], state)
            return True
        time.sleep(1)
        if time.time() - start_time > timeout:
            log.debug('Timeout reached while waiting for %s to become %s',
                      node['name'], state)
            return False
        node = get_vm_status(vmid=vmid)
        log.debug('State for %s is: "%s" instead of "%s"',
                  node['name'], node['status'], state)
684163
def listen_init(self):
        """"""
        self.dispatcher = ObjectDispatch(self)
        self.factory = MsgPackProtocolFactory(self.dispatcher)
        self.server = UnixServer(self.loop, self.factory, self.path)
        self.server.start()
1357235
def start(self):
        

        if self.status == "started":
            return

        if (yield from self.is_running()):
            raise VMwareError("The VM is already running in VMware")

        ubridge_path = self.ubridge_path
        if not ubridge_path or not os.path.isfile(ubridge_path):
            raise VMwareError("ubridge is necessary to start a VMware VM")

        yield from self._start_ubridge()
        self._read_vmx_file()
        # check if there is enough RAM to run
        if "memsize" in self._vmx_pairs:
            self.check_available_ram(int(self._vmx_pairs["memsize"]))
        self._set_network_options()
        self._set_serial_console()
        self._write_vmx_file()

        if self._headless:
            yield from self._control_vm("start", "nogui")
        else:
            yield from self._control_vm("start")

        try:
            if self._ubridge_hypervisor:
                for adapter_number in range(0, self._adapters):
                    nio = self._ethernet_adapters[adapter_number].get_nio(0)
                    if nio:
                        yield from self._add_ubridge_connection(nio, adapter_number)

            yield from self._start_console()
        except VMwareError:
            yield from self.stop()
            raise

        if self._get_vmx_setting("vhv.enable", "TRUE"):
            self._hw_virtualization = True

        self._started = True
        self.status = "started"
        log.info("VMware VM '{name}' [{id}] started".format(name=self.name, id=self.id))