modxevil / google-cloud-sdk

Automatically exported from code.google.com/p/google-cloud-sdk
0 stars 0 forks source link

inconsistent output from gcloud tool #487

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Pick your gcloud command - for instance:

gcloud compute --project "shiny-1194" instances create "bar"  --scopes 
"https://www.googleapis.com/auth/cloud-platform" --network "default" --zone 
"us-central1-f" --tags "server,https-server" --image 
"https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ub
untu-1404-trusty-v20150909a" --description "bar for bar\'s sake" 
--boot-disk-type "pd-standard" --maintenance-policy "MIGRATE" --machine-type 
"n1-standard-4" --boot-disk-device-name "bar" --boot-disk-size "100" --tags bar 
2> /tmp/foo-err > /tmp/foo-out 

This puts stdout with some of the output -

$cat /tmp/foo-out
NAME ZONE          MACHINE_TYPE  PREEMPTIBLE INTERNAL_IP EXTERNAL_IP   STATUS
bar  us-central1-f n1-standard-4             10.240.0.2  104.154.79.79 RUNNING

Stderr mixes up a warning message with a success message -

$ cat /tmp/foo-err
WARNING: You have selected a disk size of under [200GB]. This may result in 
poor I/O performance. For more information, see: 
https://developers.google.com/compute/docs/disks/persistent-disks#pdperformance.
Created 
[https://www.googleapis.com/compute/v1/projects/shiny-1194/zones/us-central1-f/i
nstances/bar].

What is the expected output? What do you see instead?

I'd like consistency. Why don't you use stderr for actual errors or warnings, 
and stdout for expected successful output?

What is the output of 'gcloud info'?

n/a

Please provide any additional information below.

Original issue reported on code.google.com by dan.far...@multiscalehn.com on 20 Jan 2016 at 8:08

GoogleCodeExporter commented 8 years ago
Thank you for your feedback. Here is how we think about 
stdout/stderr/return-code in gcloud.

stdout: Parse-able output that is directly relevant to the action you are 
performing.

stderr: Status messages about the action you are performing.

return-code: Reports whether the action you performed was successful.

Original comment by vil...@google.com on 20 Jan 2016 at 9:49