Skip to content

Commit be3a96a

Browse files
committed
style: improve empty lines management
1 parent 1318502 commit be3a96a

File tree

3 files changed

+25
-18
lines changed

3 files changed

+25
-18
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ env:
3232
- INSTANCE: default-fedora-29-2019-2-py3
3333
# - INSTANCE: default-opensuse-leap-15-2019-2-py3
3434
# - INSTANCE: default-debian-9-2018-3-py2
35-
# - INSTANCE: default-ubuntu-1604-2018-3-py2
35+
- INSTANCE: default-ubuntu-1604-2018-3-py2
3636
# - INSTANCE: default-centos-7-2018-3-py2
3737
# - INSTANCE: default-fedora-29-2018-3-py2
3838
# TODO: Use this when fixed instead of `opensuse-leap-42`
3939
# Ref: https://github.com/netmanagers/salt-image-builder/issues/2
4040
# - INSTANCE: default-opensuse-leap-15-2018-3-py2
4141
# - INSTANCE: default-opensuse-leap-42-2018-3-py2
4242
# - INSTANCE: default-debian-8-2017-7-py2
43-
- INSTANCE: tables-ubuntu-1604-2017-7-py2
43+
# - INSTANCE: tables-ubuntu-1604-2017-7-py2
4444
# TODO: Enable after improving the formula to work with other than `systemd`
4545
# - INSTANCE: default-centos-6-2017-7-py2
4646
# - INSTANCE: default-fedora-28-2017-7-py2

iptables/tables.sls

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
# -*- coding: utf-8 -*-
22
# vim: ft=sls
33

4-
{% from "iptables/map.jinja" import firewall with context %}
4+
{%- from "iptables/map.jinja" import firewall with context %}
55
6-
{% for t in ['filter','nat','mangle'] %}
7-
{% for cn, cv in firewall.get(t)|dictsort %}
8-
{% set pol = cv.policy | default('ACCEPT') %}
9-
{% set rules = cv.rules | default({}) %}
6+
{%- for t in ['filter','nat','mangle'] %}
7+
{%- for cn, cv in firewall.get(t)|dictsort %}
8+
{%- set pol = cv.policy | default('ACCEPT') %}
9+
{%- set rules = cv.rules | default({}) %}
1010
1111
chain_present_{{ t }}_{{ cn }}:
1212
iptables.chain_present:
1313
- table: {{ t }}
1414
- name: {{ cn }}
1515
16-
{% for rn, rv in rules|dictsort %}
16+
{%- for rn, rv in rules|dictsort %}
1717
rule_{{ t }}_{{ cn }}_{{ rn }}:
18-
{% if rv['position'] is defined %}
18+
{%- if rv['position'] is defined %}
1919
iptables.insert:
20-
{% else %}
20+
{%- else %}
2121
iptables.append:
22-
{% endif %}
22+
{%- endif %}
2323
- table: {{ t }}
2424
- chain: {{ cn }}
25-
{% for k,v in rv|dictsort %}
25+
{%- for k,v in rv|dictsort %}
2626
- {{ k }}: '{{ v }}'
27-
{% endfor %}
27+
{%- endfor %}
2828
- save: true
2929
- require:
3030
- iptables: chain_present_{{ t }}_{{ cn }}
31-
{% endfor %}
31+
{%- endfor %}
3232
33-
{% if cn in ['INPUT','OUTPUT','FORWARD','PREROUTING','POSTROUTING'] %}
33+
{%- if cn in ['INPUT','OUTPUT','FORWARD','PREROUTING','POSTROUTING'] %}
3434
# Set policies
3535
policy_{{ t }}_{{ cn }}_{{ pol }}:
3636
iptables.set_policy:
3737
- table: {{ t }}
3838
- chain: {{ cn }}
3939
- policy: {{ pol }}
4040
- save: true
41-
{% endif %}
42-
{% endfor %}
43-
{% endfor %}
41+
{%- endif %}
42+
{%- endfor %}
43+
{%- endfor %}

kitchen.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ platforms:
2727
driver:
2828
image: netmanagers/salt-2019.2-py3:opensuse-leap-15
2929
run_command: /usr/lib/systemd/systemd
30+
- name: ubuntu-1604-2018-3-py2
31+
driver:
32+
image: netmanagers/salt-2018.3-py2:ubuntu-16.04
33+
- name: opensuse-leap-42-2017-7-py2
34+
driver:
35+
image: netmanagers/salt-2017.7-py2:opensuse-leap-42
36+
run_command: /usr/lib/systemd/systemd
3037

3138
provisioner:
3239
name: salt_solo

0 commit comments

Comments
 (0)