5374ae2287b05d043e2e0a51991f2fa114cfd8f7
[arvados-formula.git] / TEMPLATE / libsaltcli.jinja
1 # -*- coding: utf-8 -*-
2 # vim: ft=jinja
3
4 {#- Get the relevant values from the `opts` dict #}
5 {%- set opts_cli = opts.get('__cli', '') %}
6 {%- set opts_masteropts_cli = opts | traverse('__master_opts__:__cli', '') %}
7
8 {#- Determine the type of salt command being run #}
9 {%- if opts_cli == 'salt-minion' %}
10 {%-   set cli = 'minion' %}
11 {%- elif opts_cli == 'salt-call' %}
12 {%-   set cli = 'ssh' if opts_masteropts_cli == 'salt-ssh' else 'local' %}
13 {%- else %}
14 {%-   set cli = 'unknown' %}
15 {%- endif %}
16 {%- do salt['log.debug']('[libsaltcli] the salt command type has been identified to be: ' ~ cli) %}