def ListInstances(args: 'argparse.Namespace') -> None:
  """List GCE instances in GCP project.

  Args:
    args (argparse.Namespace): Arguments from ArgumentParser.

  Raises:
    AttributeError: If no project_id was provided and none was inferred
        from the gcloud environment.
  """

  AssignProjectID(args)

  project = gcp_project.GoogleCloudProject(args.project)
  instances = project.compute.ListInstances()

  logger.info('Instances found:')
  for instance in instances.values():
    bootdisk = instance.GetBootDisk()
    if bootdisk:
      logger.info('Name: {0:s}, Bootdisk: {1:s}'.format(
          instance.name, bootdisk.name))
List GCE instances in GCP project.

Args:
args (argparse.Namespace): Arguments from ArgumentParser.

Raises:
AttributeError: If no project_id was provided and none was inferred
from the gcloud environment.
tools/gcp_cli.py