Пример #1
0
def shell_run_with_retry(cmd, retries=1, **kwargs):
    for i in range(retries + 1):
        try:
            if i > 0:
                tf.logging.info("Retry %d for %s", i, cmd)
            cloud.shell_run(cmd, **kwargs)
            return
        except sp.CalledProcessError as e:
            if i == retries:
                raise e
Пример #2
0
def shell_run_with_retry(cmd, retries=1, **kwargs):
  for i in range(retries + 1):
    try:
      if i > 0:
        tf.logging.info("Retry %d for %s", i, cmd)
      cloud.shell_run(cmd, **kwargs)
      return
    except sp.CalledProcessError as e:
      if i == retries:
        raise e
Пример #3
0
def delete_instance(instance_name):
    cloud.shell_run(DELETE, name=instance_name)
Пример #4
0
def kill_python(instance_names):
    for instance_name in instance_names:
        cloud.shell_run("ps -aux | grep python | awk '{print $2}' |xargs kill",
                        name=instance_name)
Пример #5
0
def delete_instance(instance_name):
  cloud.shell_run(DELETE, name=instance_name)