justinpaulson / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

Add utility to detect where we are running #293

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Code should be able to detect:

Running locally, on Google App Engine, or on Google Compute Engine.

Note that someone could do something wild and crazy like run dev_appserver.py 
on a GCE instance.

This will be used to determine what kind of service account to use, when we 
implement a class that wraps all the possible service account types and chooses 
the right one to use based on where it's running.

http://stackoverflow.com/questions/1916579/in-python-how-can-i-test-if-im-in-goo
gle-app-engine-sdk

https://developers.google.com/compute/docs/instances#dmi

Original issue reported on code.google.com by jcgregorio@google.com on 5 Aug 2013 at 2:42