Skip to content

Commit

Permalink
Use currently available Debian image family (#1777)
Browse files Browse the repository at this point in the history
  • Loading branch information
engelke authored Oct 19, 2018
1 parent a971361 commit 81a8413
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compute/api/create_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
# [START list_instances]
def list_instances(compute, project, zone):
result = compute.instances().list(project=project, zone=zone).execute()
return result['items']
return result['items'] if 'items' in result else None
# [END list_instances]


# [START create_instance]
def create_instance(compute, project, zone, name, bucket):
# Get the latest Debian Jessie image.
image_response = compute.images().getFromFamily(
project='debian-cloud', family='debian-8').execute()
project='debian-cloud', family='debian-9').execute()
source_disk_image = image_response['selfLink']

# Configure the machine
Expand Down

0 comments on commit 81a8413

Please sign in to comment.