|
|
@ -276,19 +276,27 @@ class Action:
|
|
|
|
for tag, value in tags.iteritems():
|
|
|
|
for tag, value in tags.iteritems():
|
|
|
|
value = str(value)
|
|
|
|
value = str(value)
|
|
|
|
m = t.search(value)
|
|
|
|
m = t.search(value)
|
|
|
|
|
|
|
|
done = []
|
|
|
|
|
|
|
|
#logSys.log(5, 'TAG: %s, value: %s' % (tag, value))
|
|
|
|
while m:
|
|
|
|
while m:
|
|
|
|
if m.group(1) == tag:
|
|
|
|
found_tag = m.group(1)
|
|
|
|
|
|
|
|
#logSys.log(5, 'found: %s' % found_tag)
|
|
|
|
|
|
|
|
if found_tag == tag or found_tag in done:
|
|
|
|
# recursive definitions are bad
|
|
|
|
# recursive definitions are bad
|
|
|
|
|
|
|
|
#logSys.log(5, 'recursion fail')
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
if tags.has_key(m.group(1)):
|
|
|
|
if tags.has_key(found_tag):
|
|
|
|
value = value[0:m.start()] + tags[m.group(1)] + value[m.end():]
|
|
|
|
value = value[0:m.start()] + tags[found_tag] + value[m.end():]
|
|
|
|
|
|
|
|
#logSys.log(5, 'value now: %s' % value)
|
|
|
|
|
|
|
|
done.append(found_tag)
|
|
|
|
m = t.search(value, m.start())
|
|
|
|
m = t.search(value, m.start())
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
# Missing tags are ok so we just continue on searching.
|
|
|
|
# Missing tags are ok so we just continue on searching.
|
|
|
|
# cInfo can contain aInfo elements like <HOST> and valid shell
|
|
|
|
# cInfo can contain aInfo elements like <HOST> and valid shell
|
|
|
|
# constructs like <STDIN>.
|
|
|
|
# constructs like <STDIN>.
|
|
|
|
m = t.search(value, m.start() + 1)
|
|
|
|
m = t.search(value, m.start() + 1)
|
|
|
|
|
|
|
|
#logSys.log(5, 'TAG: %s, newvalue: %s' % (tag, value))
|
|
|
|
tags[tag] = value
|
|
|
|
tags[tag] = value
|
|
|
|
return tags
|
|
|
|
return tags
|
|
|
|
substituteRecursiveTags = staticmethod(substituteRecursiveTags)
|
|
|
|
substituteRecursiveTags = staticmethod(substituteRecursiveTags)
|
|
|
|