Fix Oslo-Genconfig formatting

This commit is contained in:
Pete Birley 2017-04-10 11:22:22 -05:00
parent 16508c32ee
commit c68bfcf0c5
2 changed files with 67 additions and 64 deletions

View File

@ -8,10 +8,13 @@ project and/or branch desired as necessary.
``` bash ``` bash
docker build . -t gen-oslo-openstack-helm docker build . -t gen-oslo-openstack-helm
PROJECT=heat
sudo rm -rf /tmp/${PROJECT} || true
docker run -it --rm \ docker run -it --rm \
-e PROJECT="heat" \ -e PROJECT="${PROJECT}" \
-e PROJECT_BRANCH="stable/newton" \ -e PROJECT_BRANCH="stable/newton" \
-e PROJECT_REPO=https://git.openstack.org/openstack/heat.git \ -e PROJECT_REPO=https://git.openstack.org/openstack/${PROJECT}.git \
-v /tmp:/tmp:rw \
gen-oslo-openstack-helm gen-oslo-openstack-helm
``` ```

View File

@ -185,22 +185,22 @@ class _ValuesSkeletonFormatter(object):
if len(group_name.split('.')) > 1: if len(group_name.split('.')) > 1:
line = '{{- if not .%s -}}\ line = '{{- if not .%s -}}\
{{- set . "%s" dict -}}\ {{- set . "%s" dict -}}\
{{- end -}}\n' % ( {{- end -}}\n' % (
group_name.lower().split('.')[0], group_name.lower().split('.')[0],
group_name.lower().split('.')[0]) group_name.lower().split('.')[0])
if line not in self.done: if line not in self.done:
self.done.append(line) self.done.append(line)
lines.append(line) lines.append(line)
line = '{{- if not .%s.%s -}}\ line = '{{- if not .%s.%s -}}\
{{- set .%s "%s" dict -}}\ {{- set .%s "%s" dict -}}\
{{- end -}}\n' % ( {{- end -}}\n' % (
group_name.lower().split('.')[0], group_name.lower().split('.')[0],
group_name.lower().split('.')[1], group_name.lower().split('.')[1],
group_name.lower().split('.')[0], group_name.lower().split('.')[0],
group_name.lower().split('.')[1]) group_name.lower().split('.')[1])
if line not in self.done: if line not in self.done:
self.done.append(line) self.done.append(line)
@ -208,93 +208,93 @@ class _ValuesSkeletonFormatter(object):
else: else:
line = '{{- if not .%s -}}\ line = '{{- if not .%s -}}\
{{- set . "%s" dict -}}\ {{- set . "%s" dict -}}\
{{- end -}}\n' % ( {{- end -}}\n' % (
group_name.lower(), group_name.lower(),
group_name.lower()) group_name.lower())
if line not in self.done: if line not in self.done:
self.done.append(line) self.done.append(line)
lines.append(line) lines.append(line)
if len(namespace.split('.')) == 1: if len(namespace.split('.')) == 1:
line = '{{- if not .%s.%s -}}\ line = '{{- if not .%s.%s -}}\
{{- set .%s "%s" dict -}}\ {{- set .%s "%s" dict -}}\
{{- end -}}\n' % ( {{- end -}}\n' % (
group_name.lower(), group_name.lower(),
namespace, namespace,
group_name.lower(), group_name.lower(),
namespace) namespace)
if line not in self.done: if line not in self.done:
self.done.append(line) self.done.append(line)
lines.append(line) lines.append(line)
if len(namespace.split('.')) > 1: if len(namespace.split('.')) > 1:
line = '{{- if not .%s.%s -}}\ line = '{{- if not .%s.%s -}}\
{{- set .%s "%s" dict -}}\ {{- set .%s "%s" dict -}}\
{{- end -}}\n' % ( {{- end -}}\n' % (
group_name.lower(), group_name.lower(),
namespace.split('.')[0], namespace.split('.')[0],
group_name.lower(), group_name.lower(),
namespace.split('.')[0]) namespace.split('.')[0])
if line not in self.done: if line not in self.done:
self.done.append(line) self.done.append(line)
lines.append(line) lines.append(line)
line = '{{- if not .%s.%s.%s -}}\ line = '{{- if not .%s.%s.%s -}}\
{{- set .%s.%s "%s" dict -}}\ {{- set .%s.%s "%s" dict -}}\
{{- end -}}\n' % ( {{- end -}}\n' % (
group_name.lower(), group_name.lower(),
namespace.split('.')[0], namespace.split('.')[0],
namespace.split('.')[1], namespace.split('.')[1],
group_name.lower(), group_name.lower(),
namespace.split('.')[0], namespace.split('.')[0],
namespace.split('.')[1]) namespace.split('.')[1])
if line not in self.done: if line not in self.done:
self.done.append(line) self.done.append(line)
lines.append(line) lines.append(line)
if len(namespace.split('.')) > 2: if len(namespace.split('.')) > 2:
line = '{{- if not .%s.%s.%s.%s -}}\ line = '{{- if not .%s.%s.%s.%s -}}\
{{- set .%s.%s.%s "%s" dict -}}\ {{- set .%s.%s.%s "%s" dict -}}\
{{- end -}}\n' % ( {{- end -}}\n' % (
group_name.lower(), group_name.lower(),
namespace.split('.')[0], namespace.split('.')[0],
namespace.split('.')[1], namespace.split('.')[1],
namespace.split('.')[2], namespace.split('.')[2],
group_name.lower(), group_name.lower(),
namespace.split('.')[0], namespace.split('.')[0],
namespace.split('.')[1], namespace.split('.')[1],
namespace.split('.')[2]) namespace.split('.')[2])
if line not in self.done: if line not in self.done:
self.done.append(line) self.done.append(line)
lines.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 -}}\
{{- end -}}\n' % ( {{- end -}}\n' % (
group_name.lower(), group_name.lower(),
namespace, namespace,
opt.dest.split('.')[0], opt.dest.split('.')[0],
group_name.lower(), group_name.lower(),
namespace, namespace,
opt.dest.split('.')[0]) opt.dest.split('.')[0])
if line not in self.done: if line not in self.done:
self.done.append(line) self.done.append(line)
lines.append(line) lines.append(line)
if len(opt.dest.split('.')) > 2: if len(opt.dest.split('.')) > 2:
line = '{{- if not .%s.%s.%s.%s -}}\ line = '{{- if not .%s.%s.%s.%s -}}\
{{- set .%s.%s.%s "%s" dict -}}\ {{- set .%s.%s.%s "%s" dict -}}\
{{- end -}}\n' % ( {{- end -}}\n' % (
group_name.lower(), group_name.lower(),
namespace, namespace,
opt.dest.split('.')[0], opt.dest.split('.')[0],
opt.dest.split('.')[1], opt.dest.split('.')[1],
group_name.lower(), group_name.lower(),
namespace, namespace,
opt.dest.split('.')[0], opt.dest.split('.')[0],
opt.dest.split('.')[1]) opt.dest.split('.')[1])
if line not in self.done: if line not in self.done:
self.done.append(line) self.done.append(line)
lines.append(line) lines.append(line)