Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Conversation

@ojarjur
Copy link
Contributor

@ojarjur ojarjur commented May 8, 2018

This changes the CLI end-to-end test so that it defaults to
picking a random zone in the region 'us-west' instead of being
hard-coded to 'us-west1-a'.

The test will still honor the 'zone' config setting in gcloud if
it is set; this only changes the behavior when that is not set.

This changes the CLI end-to-end test so that it defaults to
picking a random zone in the region 'us-west' instead of being
hard-coded to 'us-west1-a'.

The test will still honor the 'zone' config setting in gcloud if
it is set; this only changes the behavior when that is not set.
@ojarjur ojarjur requested review from qimingj and yelsayd May 8, 2018 20:45
def random_zone():
zones_list = subprocess.check_output([
'gcloud', 'compute', 'zones', 'list',
'--filter=region~us-west', '--format=value(name)']).decode(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be --format=value("name")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No; the string is already in quotes, so nested quotes would be passed directly to the format handler, which would not know what to do with them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, what threw me off is I didn't know this actually executed as 'gcloud' 'compute'... etc (with the quotes). It fails for me without the quotes.

@ojarjur ojarjur merged commit 57c55d3 into master May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants