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,8 +185,8 @@ 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])
@ -195,8 +195,8 @@ class _ValuesSkeletonFormatter(object):
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],
@ -208,8 +208,8 @@ 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:
@ -218,8 +218,8 @@ class _ValuesSkeletonFormatter(object):
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(),
@ -230,8 +230,8 @@ class _ValuesSkeletonFormatter(object):
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(),
@ -241,8 +241,8 @@ class _ValuesSkeletonFormatter(object):
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],
@ -255,8 +255,8 @@ class _ValuesSkeletonFormatter(object):
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],
@ -271,8 +271,8 @@ class _ValuesSkeletonFormatter(object):
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],
@ -285,8 +285,8 @@ class _ValuesSkeletonFormatter(object):
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],