From 7f12507f9f0668f643d296e7ea64d4d581baf472 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Mon, 10 Apr 2017 11:44:59 -0500 Subject: [PATCH] Let genconfig work with extra level of oslo namespacing --- tools/gen-oslo-openstack-helm/generate.py | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tools/gen-oslo-openstack-helm/generate.py b/tools/gen-oslo-openstack-helm/generate.py index c10e0b05ca..9a8ca4111a 100755 --- a/tools/gen-oslo-openstack-helm/generate.py +++ b/tools/gen-oslo-openstack-helm/generate.py @@ -269,6 +269,24 @@ class _ValuesSkeletonFormatter(object): self.done.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: line = '{{- if not .%s.%s.%s -}}\ {{- set .%s.%s "%s" dict -}}\ @@ -299,6 +317,24 @@ class _ValuesSkeletonFormatter(object): self.done.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: self.writelines(lines)