forked from TrueCloudLab/frostfs-testlib
[#264] Add APE related commands
Signed-off-by: a.berezin <a.berezin@yadro.com>
This commit is contained in:
parent
f472d7e1ce
commit
40dfd015a8
7 changed files with 257 additions and 3 deletions
|
@ -8,7 +8,7 @@ DIGITS_AND_ASCII_LETTERS = string.ascii_letters + string.digits
|
|||
NON_DIGITS_AND_LETTERS = string.punctuation
|
||||
|
||||
|
||||
def unique_name(prefix: str = ""):
|
||||
def unique_name(prefix: str = "", postfix: str = ""):
|
||||
"""
|
||||
Generate unique short name of anything with prefix.
|
||||
This should be unique in scope of multiple runs
|
||||
|
@ -18,7 +18,7 @@ def unique_name(prefix: str = ""):
|
|||
Returns:
|
||||
unique name string
|
||||
"""
|
||||
return f"{prefix}{hex(int(datetime.now().timestamp() * 1000000))}"
|
||||
return f"{prefix}{hex(int(datetime.now().timestamp() * 1000000))}{postfix}"
|
||||
|
||||
|
||||
def random_string(length: int = 5, source: str = ONLY_ASCII_LETTERS):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue