def DetectGce():
    "Determine whether or not we're running on GCE.\n\n  This is based on:\n    https://developers.google.com/compute/docs/instances#dmi\n\n  Returns:\n    True iff we're running on a GCE instance.\n  "
    try:
        o = urllib2.urlopen('http://metadata.google.internal')
    except urllib2.URLError:
        return False
    return (o.getcode() == httplib.OK)
Determine whether or not we're running on GCE.

This is based on:
  https://developers.google.com/compute/docs/instances#dmi

Returns:
  True iff we're running on a GCE instance.
def DetectGce():
    "Determine whether or not we're running on GCE.\n\n  This is based on:\n    https://developers.google.com/compute/docs/instances#dmi\n\n  Returns:\n    True iff we're running on a GCE instance.\n  "
    try:
        o = urllib2.urlopen('http://metadata.google.internal')
    except urllib2.URLError:
        return False
    return (o.getcode() == httplib.OK)