Skip to content

Commit aaa8360

Browse files
author
Rebecca Shaw
committed
limit scope of import of os, fix create namespace to not create endpoint instead
1 parent 29d9d19 commit aaa8360

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

servicedirectory/snippets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def create_namespace(project_id, location_id, namespace_id):
2222

2323
client = servicedirectory_v1beta1.RegistrationServiceClient()
2424

25-
namespace = servicedirectory_v1beta1.Endpoint(
25+
namespace = servicedirectory_v1beta1.Namespace(
2626
name='projects/{0}/locations/{1}/namespaces/{2}'.format(
2727
project_id, location_id, namespace_id))
2828

servicedirectory/snippets_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import os
17+
from os import environ
1818
import pytest
1919
import snippets
2020
from google.cloud import servicedirectory_v1beta1
2121

22-
PROJECT_ID = os.environ['GCLOUD_PROJECT']
22+
PROJECT_ID = environ['GCLOUD_PROJECT']
2323
LOCATION_ID = 'us-east1'
2424
NAMESPACE_ID = 'a-namespace'
2525
SERVICE_ID = 'a-service'

0 commit comments

Comments
 (0)