Skip to content

Commit 9e8e1e8

Browse files
committed
fix(compose-ng.sls): fix salt-lint errors
```bash Examining docker/compose-ng.sls of type state [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:13 {{id}}: [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:17 {{id}} image: [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:22 - name: {{image[0]}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:23 - tag: {{image[1]}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:25 - name: {{container.image}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:28 {{id}} container: [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:40 - name: {{id}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:41 - image: {{container.image}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:43 - command: {{container.command}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:48 - {{variable}}: {{value}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:57 - "{{mapping[0]}}" [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:59 - "{{mapping[-1]}}/tcp": [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:60 HostPort: "{{mapping[-2]}}" [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:61 HostIp: "{{mapping[-3]|d('')}}" [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:64 - {{port_mapping}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:71 - {{volume}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:78 - {{volume}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:86 {{name}}: {{alias}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:92 Name: {{policy[0]}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:94 MaximumRetryCount: {{policy[1]}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:99 - docker_image: {{id}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:101 - docker: {{id}} image [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:106 - docker_image: {{containerid}} [206] Jinja variables should have spaces before and after: {{ var_name }} docker/compose-ng.sls:108 - docker: {{containerid}} ```
1 parent ea6be11 commit 9e8e1e8

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

docker/compose-ng.sls

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ include:
1010
{%- set id = container.container_name|d(name) %}
1111
{%- set required_containers = [] %}
1212
{%- if grains['saltversioninfo'] >= [2017, 7, 0] %}
13-
{{id}}:
13+
{{ id }}:
1414
docker_image.present:
1515
- force: {{ docker.containers.force_present }}
1616
{%- else %}
17-
{{id}} image:
17+
{{ id }} image:
1818
docker.pulled:
1919
{%- endif %}
2020
{%- if ':' in container.image %}
2121
{%- set image = container.image.split(':',1) %}
22-
- name: {{image[0]}}
23-
- tag: {{image[1]}}
22+
- name: {{ image[0] }}
23+
- tag: {{ image[1] }}
2424
{%- else %}
25-
- name: {{container.image}}
25+
- name: {{ container.image }}
2626
{%- endif %}
2727
28-
{{id}} container:
28+
{{ id }} container:
2929
{%- if grains['saltversioninfo'] >= [2017, 7, 0] %}
3030
docker_container.running:
3131
- skip_translate: {{ docker.containers.skip_translate }}
@@ -37,15 +37,15 @@ include:
3737
docker.running:
3838
{%- endif %}
3939
{%- endif %}
40-
- name: {{id}}
41-
- image: {{container.image}}
40+
- name: {{ id }}
41+
- image: {{ container.image }}
4242
{%- if 'command' in container %}
43-
- command: {{container.command}}
43+
- command: {{ container.command }}
4444
{%- endif %}
4545
{%- if 'environment' in container and container.environment is iterable %}
4646
- environment:
4747
{%- for variable, value in container.environment.items() %}
48-
- {{variable}}: {{value}}
48+
- {{ variable }}: {{ value }}
4949
{%- endfor %}
5050
{%- endif %}
5151
{%- if 'ports' in container and container.ports is iterable %}
@@ -54,58 +54,58 @@ include:
5454
{%- if port_mapping is string %}
5555
{%- set mapping = port_mapping.split(':',2) %}
5656
{%- if mapping|length < 2 %}
57-
- "{{mapping[0]}}"
57+
- "{{ mapping[0] }}"
5858
{%- else %}
59-
- "{{mapping[-1]}}/tcp":
60-
HostPort: "{{mapping[-2]}}"
61-
HostIp: "{{mapping[-3]|d('')}}"
59+
- "{{ mapping[-1] }}/tcp":
60+
HostPort: "{{ mapping[-2] }}"
61+
HostIp: "{{ mapping[-3]|d('') }}"
6262
{%- endif %}
6363
{%- elif port_mapping is mapping %}
64-
- {{port_mapping}}
64+
- {{ port_mapping }}
6565
{%- endif %}
6666
{%- endfor %}
6767
{%- endif %}
6868
{%- if 'volumes' in container %}
6969
- volumes:
7070
{%- for volume in container.volumes %}
71-
- {{volume}}
71+
- {{ volume }}
7272
{%- endfor %}
7373
{%- endif %}
7474
{%- if 'volumes_from' in container %}
7575
- volumes_from:
7676
{%- for volume in container.volumes_from %}
7777
{%- do required_containers.append(volume) %}
78-
- {{volume}}
78+
- {{ volume }}
7979
{%- endfor %}
8080
{%- endif %}
8181
{%- if 'links' in container %}
8282
- links:
8383
{%- for link in container.links %}
8484
{%- set name, alias = link.split(':',1) %}
8585
{%- do required_containers.append(name) %}
86-
{{name}}: {{alias}}
86+
{{ name }}: {{ alias }}
8787
{%- endfor %}
8888
{%- endif %}
8989
{%- if 'restart' in container %}
9090
- restart_policy:
9191
{%- set policy = container.restart.split(':',1) %}
92-
Name: {{policy[0]}}
92+
Name: {{ policy[0] }}
9393
{%- if policy|length > 1 %}
94-
MaximumRetryCount: {{policy[1]}}
94+
MaximumRetryCount: {{ policy[1] }}
9595
{%- endif %}
9696
{%- endif %}
9797
- require:
9898
{%- if grains['saltversioninfo'] >= [2017, 7, 0] %}
99-
- docker_image: {{id}}
99+
- docker_image: {{ id }}
100100
{%- else %}
101-
- docker: {{id}} image
101+
- docker: {{ id }} image
102102
{%- endif %}
103103
{%- if required_containers is defined %}
104104
{%- for containerid in required_containers %}
105105
{%- if grains['saltversioninfo'] >= [2017, 7, 0] %}
106-
- docker_image: {{containerid}}
106+
- docker_image: {{ containerid }}
107107
{%- else %}
108-
- docker: {{containerid}}
108+
- docker: {{ containerid }}
109109
{%- endif %}
110110
{%- endfor %}
111111
{%- endif %}

0 commit comments

Comments
 (0)