Skip to content

Commit

Permalink
fix(toml_pkg): fix yamllint errors
Browse files Browse the repository at this point in the history
```bash
telegraf-formula$ yamllint -s .
./telegraf/osfamilymap.yaml
  35:89     error    line too long (102 > 88 characters)  (line-length)

./telegraf/osfingermap.yaml
  14:2      error    syntax error: found character '%' that cannot start any token
  75:89     error    line too long (117 > 88 characters)  (line-length)
```
  • Loading branch information
myii committed Oct 2, 2019
1 parent a09308e commit 9e2fe52
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 56 deletions.
1 change: 1 addition & 0 deletions telegraf/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ telegraf:
config: /etc/telegraf/telegraf.conf
system_user: root
system_group: root
toml_pkg: python-pytoml
pkg:
name: telegraf
service:
Expand Down
15 changes: 15 additions & 0 deletions telegraf/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,18 @@
%}

{%- set telegraf = config %}

{#- Post-processing for specific non-YAML customisations #}
{%- if grains.pythonversion[0] == 2 %}
{%- if grains.os in ['Fedora'] %}
{%- do telegraf.update({'toml_pkg': 'python2-toml'}) %}
{%- elif grains.os in ['openSUSE', 'SUSE'] %}
{%- do telegraf.update({'toml_pkg': 'python2-pytoml'}) %}
{%- endif %}
{%- elif grains.pythonversion[0] == 3 %}
{%- if grains.os in ['CentOS'] %}
{%- do telegraf.update({'toml_pkg': 'python36-pytoml'}) %}
{%- else %}
{%- do telegraf.update({'toml_pkg': 'python3-pytoml'}) %}
{%- endif %}
{%- endif %}
1 change: 1 addition & 0 deletions telegraf/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ Suse:
name: go
enabled: 1
gpgautoimport: true
# yamllint disable-line rule:line-length
baseurl: https://download.opensuse.org/repositories/devel:/languages:/go/openSUSE_Leap_$releasever
57 changes: 1 addition & 56 deletions telegraf/osfingermap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,66 +10,11 @@
# you will need to provide at least an empty dict in this file, e.g.
# osfingermap: {}
---
Debian-10:
{% if grains['pythonversion'][0] == 3 %}
toml_pkg: python3-pytoml
{% else %}
toml_pkg: python-pytoml
{% endif %}

Debian-9:
{% if grains['pythonversion'][0] == 3 %}
toml_pkg: python3-pytoml
{% else %}
toml_pkg: python-pytoml
{% endif %}

Debian-8:
toml_pkg: python-pytoml

Ubuntu-18.04:
toml_pkg: python3-pytoml

Ubuntu-16.04:
toml_pkg: python-pytoml

CentOS Linux-7:
{% if grains['pythonversion'][0] == 3 %}
toml_pkg: python36-pytoml
{% else %}
toml_pkg: python-pytoml
{% endif %}

Fedora-29:
{% if grains['pythonversion'][0] == 3 %}
toml_pkg: python3-pytoml
{% else %}
toml_pkg: python2-toml
{% endif %}

Fedora-28:
{% if grains['pythonversion'][0] == 3 %}
toml_pkg: python3-pytoml
{% else %}
toml_pkg: python2-pytoml
{% endif %}

Leap-15:
{% if grains['pythonversion'][0] == 3 %}
toml_pkg: python3-pytoml
{% else %}
toml_pkg: python2-pytoml
{% endif %}

Leap-42:
{% if grains['pythonversion'][0] == 3 %}
toml_pkg: python3-pytoml
{% else %}
toml_pkg: python-pytoml
{% endif %}
repo_python:
humanname: Python backports
name: python-backports
enabled: 1
gpgautoimport: true
# yamllint disable-line rule:line-length
baseurl: https://download.opensuse.org/repositories/devel:/languages:/python:/backports/openSUSE_Leap_$releasever

0 comments on commit 9e2fe52

Please sign in to comment.