Browse Source

Merge "Add placeholder for lowercase node names"

changes/51/779551/1
Zuul 4 months ago
committed by Gerrit Code Review
parent
commit
68c1b31768
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      senlin/common/utils.py

+ 4
- 2
senlin/common/utils.py 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)


Loading…
Cancel
Save