Skip to content

Commit

Permalink
Cosmetics: cleanup .get('var', None) syntax
Browse files Browse the repository at this point in the history
=> can be written: .get('var')
  • Loading branch information
bbinet committed Feb 16, 2018
1 parent 5e9c82b commit ce54f1d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions aptly/meta/sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ doc:
gpg:
value:
keypair_id: {{ server.gpg.keypair_id }}
{%- if server.gpg.get('keyring', None) %}
{%- if server.gpg.get('keyring') %}
keyring: {{ server.gpg.keyring }}
{%- endif %}
{%- if server.gpg.get('homedir', None) %}
homedir: {{ server.gpg.get('homedir', None) }}
{%- if server.gpg.get('homedir') %}
homedir: {{ server.gpg.get('homedir') }}
{%- endif %}
{%- endif %}
directories:
Expand Down
8 changes: 4 additions & 4 deletions aptly/server/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,18 @@ gpg_pub_key:
import_gpg_pub_key:
cmd.run:
- name: gpg --no-tty{% if server.gpg.get('homedir', None) %} --homedir {{ server.gpg.homedir }}{% endif %} --import {{ gpgpubfile }}
- name: gpg --no-tty{% if server.gpg.get('homedir') %} --homedir {{ server.gpg.homedir }}{% endif %} --import {{ gpgpubfile }}
- user: {{ server.user.name }}
- unless: gpg --no-tty{% if server.gpg.get('homedir', None) %} --homedir {{ server.gpg.homedir }}{% endif %} --list-keys | grep '{{ server.gpg.keypair_id }}'
- unless: gpg --no-tty{% if server.gpg.get('homedir') %} --homedir {{ server.gpg.homedir }}{% endif %} --list-keys | grep '{{ server.gpg.keypair_id }}'
- require:
- file: gpg_pub_key
- cmd: import_gpg_priv_key
import_gpg_priv_key:
cmd.run:
- name: gpg --no-tty --allow-secret-key-import{% if server.gpg.get('homedir', None) %} --homedir {{ server.gpg.homedir }}{% endif %} --import {{ gpgprivfile }}
- name: gpg --no-tty --allow-secret-key-import{% if server.gpg.get('homedir') %} --homedir {{ server.gpg.homedir }}{% endif %} --import {{ gpgprivfile }}
- user: {{ server.user.name }}
- unless: gpg --no-tty{% if server.gpg.get('homedir', None) %} --homedir {{ server.gpg.homedir }}{% endif %} --list-secret-keys | grep '{{ server.gpg.keypair_id }}'
- unless: gpg --no-tty{% if server.gpg.get('homedir') %} --homedir {{ server.gpg.homedir }}{% endif %} --list-secret-keys | grep '{{ server.gpg.keypair_id }}'
- require:
- file: aptly_gpg_key_dir
- file: gpg_priv_key
Expand Down
4 changes: 2 additions & 2 deletions aptly/server/mirrors.sls
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ aptly_mirror_update_cron:
gpg_add_keys_{{ mirror_name }}_{{ gpgkey }}:
cmd.run:
- name: gpg --no-tty {% if server.gpg.get('keyring', None) %} --no-default-keyring --keyring {{ server.gpg.keyring }} {% endif %}{% if server.gpg.get('homedir', None) %} --homedir {{ server.gpg.homedir }}{% endif %} --keyserver {{ mirror.keyserver|default(server.gpg.keyserver) }} {% if server.gpg.get('http_proxy', None) %} --keyserver-options http-proxy={{ server.gpg.get('http_proxy') }} {% endif %} --recv-keys {{ gpgkey }}
- name: gpg --no-tty {% if server.gpg.get('keyring') %} --no-default-keyring --keyring {{ server.gpg.keyring }} {% endif %}{% if server.gpg.get('homedir') %} --homedir {{ server.gpg.homedir }}{% endif %} --keyserver {{ mirror.keyserver|default(server.gpg.keyserver) }} {% if server.gpg.get('http_proxy') %} --keyserver-options http-proxy={{ server.gpg.get('http_proxy') }} {% endif %} --recv-keys {{ gpgkey }}
- user: {{ server.user.name }}
- cwd: {{ server.home_dir }}
- unless: gpg --no-tty {% if server.gpg.get('keyring', None) %} --no-default-keyring --keyring {{ server.gpg.keyring }} {% endif %}{% if server.gpg.get('homedir', None) %} --homedir {{ server.gpg.homedir }} {% endif %} {% if server.gpg.get('http_proxy', None) %} --keyserver-options http-proxy={{ server.gpg.get('http_proxy') }} {% endif %} --list-public-keys {{gpgkey}}
- unless: gpg --no-tty {% if server.gpg.get('keyring') %} --no-default-keyring --keyring {{ server.gpg.keyring }} {% endif %}{% if server.gpg.get('homedir') %} --homedir {{ server.gpg.homedir }} {% endif %} {% if server.gpg.get('http_proxy') %} --keyserver-options http-proxy={{ server.gpg.get('http_proxy') }} {% endif %} --list-public-keys {{gpgkey}}
{%- if server.secure %}
- require:
- cmd: import_gpg_priv_key
Expand Down

0 comments on commit ce54f1d

Please sign in to comment.