Cancel a dedicated host server immediately
198012
def cli(env, identifier):
    """"""

    mgr = SoftLayer.DedicatedHostManager(env.client)

    host_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'dedicated host')

    if not (env.skip_confirmations or formatting.no_going_back(host_id)):
        raise exceptions.CLIAbort('Aborted')

    mgr.cancel_host(host_id)

    click.secho('Dedicated Host %s was cancelled' % host_id, fg='green')
529595
def close(self) -> Awaitable[None]:
        """"""
        for ev in self._throttle_dns_events.values():
            ev.cancel()

        return super().close()
86857
public synchronized void cancelAllRemoteForwarding(boolean killActiveTunnels)
			throws SshException {

		if (remoteforwardings == null) {
			return;
		}

		for (Enumeration<String> e = remoteforwardings.keys(); e
				.hasMoreElements();) {
			String host = (String) e.nextElement();

			if (host == null)
				return;

			try {
				int idx = host.indexOf(':');
				int port = -1;
				if (idx == -1) {
					port = Integer.parseInt(host);
					host = "";
				} else {
					port = Integer.parseInt(host.substring(idx + 1));
					host = host.substring(0, idx);
				}
				cancelRemoteForwarding(host, port, killActiveTunnels);
			} catch (NumberFormatException nfe) {

			}
		}
	}
488154
def stop(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.hard_shutdown(vm_uuid)
            return True
        except Exception:
            return False
1172782
def remove_known_hosts(overcloud_ip):
    """"""

    known_hosts = os.path.expanduser("~/.ssh/known_hosts")

    if os.path.exists(known_hosts):
        command = ['ssh-keygen', '-R', overcloud_ip, '-f', known_hosts]
        subprocess.check_call(command)
804914
def destroy(self):
        """"""
        r = api.Resources(self.provider_conf.to_dict())
        # insert force_deploy
        r.destroy()
1370167
def close_connection(self, host):
        """"""
        for h in self._cm.get_all(host):
            self._cm.remove(h)
            h.close()
1201560
def cli(env, identifier):
    """"""

    mgr = SoftLayer.HardwareManager(env.client)
    hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware')
    if not (env.skip_confirmations or
            formatting.confirm('This will power off the server with id %s and '
                               'reflash device firmware. Continue?' % hw_id)):
        raise exceptions.CLIAbort('Aborted.')

    mgr.reflash_firmware(hw_id)
914264
def cancel(self):
        """"""
        if self.started and not self.connected and not self.timedout:
            self.connect_watcher.stop()
            self.timeout_watcher.stop()
941689
private void stopServer() throws IOException {

        // build stop command for Unix platforms
        String cmd = dir + File.separator + "wlp" + File.separator + "bin" + File.separator + "server stop " + serverName;

        if (platformType == SelfExtractUtils.PlatformType_UNIX) {
            // use command as-is
        } else if (platformType == SelfExtractUtils.PlatformType_WINDOWS) {
            cmd = "cmd /k " + cmd;
        } else if (platformType == SelfExtractUtils.PlatformType_CYGWIN) {
            cmd = "bash -c  " + '"' + cmd.replace('\\', '/') + '"';
        }

        Runtime.getRuntime().exec(cmd, SelfExtractUtils.runEnv(dir), null); // stop server

    }
735060
def cancel_per_farm_db_replication():
    
    cloud_url = config["cloud_server"]["url"]
    local_url = config["local_server"]["url"]
    server = Server(local_url)
    for db_name in per_farm_dbs:
        server.cancel_replication(db_name)
364490
def del_all_host_downtimes(self, host):
        
        for downtime in host.downtimes:
            self.del_host_downtime(downtime)
        self.send_an_element(host.get_update_status_brok())
202618
def server_off(self):
        '''  '''
        if (self.server.is_server_running() == 'yes' or
                self.server.is_server_running() == 'maybe'):
            self.server.shutdown()
            print 'Please wait. This could take a few seconds.'
            time.sleep(0.5)
293605
def stop(self, host, port):
        

        args = {
            "host": host,
            "port": port,
        }
        self._rtinfo_stop_params_chk.check(args)

        return self._client.json("rtinfo.stop", args)
919588
public void resetOldsBlackListHosts() {
    long currentTimeNanos = System.nanoTime();
    Set<Map.Entry<HostAddress, Long>> entries = blacklist.entrySet();
    for (Map.Entry<HostAddress, Long> blEntry : entries) {
      long entryNanos = blEntry.getValue();
      long durationSeconds = TimeUnit.NANOSECONDS.toSeconds(currentTimeNanos - entryNanos);
      if (durationSeconds >= urlParser.getOptions().loadBalanceBlacklistTimeout) {
        blacklist.remove(blEntry.getKey(), entryNanos);
      }
    }
  }
39446
def invalidate(self):
        """"""

        super(RedisTransport, self).invalidate()
        for server in self._servers:
            server['redis'].connection_pool.disconnect()
        return False
163452
def delete_hosting_device_resources(self, context, tenant_id, mgmt_port,
                                        **kwargs):
        """"""

        if mgmt_port is not None:
            try:
                self._cleanup_hosting_port(context, mgmt_port['id'])
            except n_exc.NeutronException as e:
                LOG.error("Unable to delete port:%(port)s after %(tries)d"
                          " attempts due to exception %(exception)s. "
                          "Skipping it", {'port': mgmt_port['id'],
                                          'tries': DELETION_ATTEMPTS,
                                          'exception': str(e)})