Merge "Add placeholder for lowercase node names"

This commit is contained in:
Zuul 2021-03-08 07:14:08 +00:00 committed by Gerrit Code Review
commit 68c1b31768
1 changed files with 4 additions and 2 deletions

View File

@ -164,16 +164,18 @@ def format_node_name(fmt, cluster, index):
result = ""
last = 0
pattern = re.compile("(\$\d{0,8}[RI])")
pattern = re.compile("(\$\d{0,8}[rRI])")
for m in pattern.finditer(fmt):
group = m.group()
t = group[-1]
width = group[1:-1]
if t == "R": # random string
if t == "R" or t == "r": # random string
if width != "":
sub = random_name(int(width))
else:
sub = random_name(8)
if t == "r":
sub = sub.lower()
elif t == "I": # node index
if width != "":
str_index = str(index)