Let genconfig work with extra level of oslo namespacing

This commit is contained in:
Pete Birley 2017-04-10 11:44:59 -05:00
parent c68bfcf0c5
commit 7f12507f9f

View File

@ -269,6 +269,24 @@ class _ValuesSkeletonFormatter(object):
self.done.append(line) self.done.append(line)
lines.append(line) lines.append(line)
if len(namespace.split('.')) > 3:
line = '{{- if not .%s.%s.%s.%s.%s -}}\
{{- set .%s.%s.%s.%s "%s" dict -}}\
{{- end -}}\n' % (
group_name.lower(),
namespace.split('.')[0],
namespace.split('.')[1],
namespace.split('.')[2],
namespace.split('.')[3],
group_name.lower(),
namespace.split('.')[0],
namespace.split('.')[1],
namespace.split('.')[2],
namespace.split('.')[3])
if line not in self.done:
self.done.append(line)
lines.append(line)
if len(opt.dest.split('.')) > 1: if len(opt.dest.split('.')) > 1:
line = '{{- if not .%s.%s.%s -}}\ line = '{{- if not .%s.%s.%s -}}\
{{- set .%s.%s "%s" dict -}}\ {{- set .%s.%s "%s" dict -}}\
@ -299,6 +317,24 @@ class _ValuesSkeletonFormatter(object):
self.done.append(line) self.done.append(line)
lines.append(line) lines.append(line)
if len(opt.dest.split('.')) > 3:
line = '{{- if not .%s.%s.%s.%s.%s -}}\
{{- set .%s.%s.%s.%s "%s" dict -}}\
{{- end -}}\n' % (
group_name.lower(),
namespace,
opt.dest.split('.')[0],
opt.dest.split('.')[1],
opt.dest.split('.')[2],
group_name.lower(),
namespace,
opt.dest.split('.')[0],
opt.dest.split('.')[1],
opt.dest.split('.')[2])
if line not in self.done:
self.done.append(line)
lines.append(line)
if lines: if lines:
self.writelines(lines) self.writelines(lines)