Skip to content

Commit

Permalink
use ACCOUNT_ID from moto.core in kinesisvideo
Browse files Browse the repository at this point in the history
  • Loading branch information
toshitanian committed Sep 1, 2020
1 parent 6384f37 commit 41a2eb0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions moto/kinesisvideo/models.py
Expand Up @@ -8,6 +8,8 @@
)
import random
import string
from moto.core.utils import get_random_hex
from moto.core import ACCOUNT_ID


class Stream(BaseModel):
Expand All @@ -31,16 +33,12 @@ def __init__(
self.status = "ACTIVE"
self.version = self._get_random_string()
self.creation_time = datetime.utcnow()
stream_arn = "arn:aws:kinesisvideo:{}:123456789012:stream/{}/1598784211076".format(
self.region_name, self.stream_name
stream_arn = "arn:aws:kinesisvideo:{}:{}:stream/{}/1598784211076".format(
self.region_name, ACCOUNT_ID, self.stream_name
)
self.data_endpoint_number = self._get_random_hex()
self.data_endpoint_number = get_random_hex()
self.arn = stream_arn

def _get_random_hex(self, length=8):
chars = list("1234567890abcdef")
return "".join([random.choice(chars) for _ in range(length)])

def _get_random_string(self, length=20):
letters = string.ascii_lowercase
result_str = "".join([random.choice(letters) for _ in range(length)])
Expand Down

0 comments on commit 41a2eb0

Please sign in to comment.