File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ def _lazy_property_deco(deferred_callable):
112112 return _LazyProperty (deferred_callable .__name__ , deferred_callable )
113113
114114
115- def app_engine_id ():
115+ def _app_engine_id ():
116116 """Gets the App Engine application ID if it can be inferred.
117117
118118 :rtype: string or ``NoneType``
@@ -125,7 +125,7 @@ def app_engine_id():
125125 return app_identity .get_application_id ()
126126
127127
128- def compute_engine_id ():
128+ def _compute_engine_id ():
129129 """Gets the Compute Engine project ID if it can be inferred.
130130
131131 Uses 169.254.169.254 for the metadata server to avoid request
Original file line number Diff line number Diff line change 1919"""
2020
2121import os
22- import socket
2322
24- from six .moves .http_client import HTTPConnection # pylint: disable=F0401
25-
26- from gcloud ._helpers import app_engine_id
27- from gcloud ._helpers import compute_engine_id
23+ from gcloud ._helpers import _app_engine_id
24+ from gcloud ._helpers import _compute_engine_id
2825from gcloud ._helpers import _lazy_property_deco
2926from gcloud import credentials
3027from gcloud .datastore .connection import Connection
@@ -72,10 +69,10 @@ def _determine_default_dataset_id(dataset_id=None):
7269 dataset_id = _get_gcd_dataset_id ()
7370
7471 if dataset_id is None :
75- dataset_id = app_engine_id ()
72+ dataset_id = _app_engine_id ()
7673
7774 if dataset_id is None :
78- dataset_id = compute_engine_id ()
75+ dataset_id = _compute_engine_id ()
7976
8077 return dataset_id
8178
Original file line number Diff line number Diff line change @@ -154,8 +154,8 @@ def gce_mock():
154154 patched_methods = {
155155 '_get_production_dataset_id' : prod_mock ,
156156 '_get_gcd_dataset_id' : gcd_mock ,
157- 'app_engine_id ' : gae_mock ,
158- 'compute_engine_id ' : gce_mock ,
157+ '_app_engine_id ' : gae_mock ,
158+ '_compute_engine_id ' : gce_mock ,
159159 }
160160
161161 with _Monkey (_implicit_environ , ** patched_methods ):
Original file line number Diff line number Diff line change @@ -95,11 +95,11 @@ def test_func():
9595 self .assertEqual (lazy_prop ._name , 'test_func' )
9696
9797
98- class Test_app_engine_id (unittest2 .TestCase ):
98+ class Test__app_engine_id (unittest2 .TestCase ):
9999
100100 def _callFUT (self ):
101- from gcloud ._helpers import app_engine_id
102- return app_engine_id ()
101+ from gcloud ._helpers import _app_engine_id
102+ return _app_engine_id ()
103103
104104 def test_no_value (self ):
105105 from gcloud ._testing import _Monkey
@@ -120,11 +120,11 @@ def test_value_set(self):
120120 self .assertEqual (dataset_id , APP_ENGINE_ID )
121121
122122
123- class Test_compute_engine_id (unittest2 .TestCase ):
123+ class Test__compute_engine_id (unittest2 .TestCase ):
124124
125125 def _callFUT (self ):
126- from gcloud ._helpers import compute_engine_id
127- return compute_engine_id ()
126+ from gcloud ._helpers import _compute_engine_id
127+ return _compute_engine_id ()
128128
129129 def _monkeyConnection (self , connection ):
130130 from gcloud ._testing import _Monkey
You can’t perform that action at this time.
0 commit comments