Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a2ebf62

Browse files
author
Takashi Matsuo
authored
[iot] fix: use uuid instead of time for resource name (GoogleCloudPlatform#3297)
fixes GoogleCloudPlatform#3122
1 parent 4922b84 commit a2ebf62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

iot/api-client/gcs_file_to_device/gcs_send_to_device_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import os
1616
import sys
1717
import tempfile
18-
import time
18+
import uuid
1919

2020
from google.cloud import pubsub
2121
from google.cloud import storage
@@ -34,9 +34,9 @@
3434
project_id = os.environ['GCLOUD_PROJECT']
3535
service_account_json = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
3636

37-
topic_id = 'test-device-events-{}'.format(int(time.time()))
38-
device_id = 'test-device-{}'.format(int(time.time()))
39-
registry_id = 'test-registry-{}'.format(int(time.time()))
37+
topic_id = 'test-device-events-{}'.format(str(uuid.uuid4()))
38+
device_id = 'test-device-{}'.format(str(uuid.uuid4()))
39+
registry_id = 'test-registry-{}'.format(str(uuid.uuid4()))
4040
pubsub_topic = 'projects/{}/topics/{}'.format(project_id, topic_id)
4141

4242
cloud_region = 'us-central1'

0 commit comments

Comments
 (0)