test(default): use `grains.get` for `oscodename` (for FreeBSD) [skip ci]

Otherwise encounter this failure in the CI on FreeBSD:

```
salt.exceptions.SaltRenderError: Jinja variable 'dict object' has no attribute 'oscodename'
[CRITICAL] Pillar render error: Rendering SLS 'openssh' failed. Please see master log for details.
```
This commit is contained in:
Imran Iqbal 2021-12-22 11:12:46 +00:00
parent 5fa1caab0b
commit aa8f9dbfd6
No known key found for this signature in database
GPG Key ID: 6D8629439D2B7819
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ sshd_config:
{%- endif %} {%- endif %}
{#- Need this on various platforms to avoid the `kitchen verify` failure as mentioned above; see: #} {#- Need this on various platforms to avoid the `kitchen verify` failure as mentioned above; see: #}
{#- * https://gitlab.com/saltstack-formulas/infrastructure/salt-image-builder/-/commit/cb6781a2bba9 #} {#- * https://gitlab.com/saltstack-formulas/infrastructure/salt-image-builder/-/commit/cb6781a2bba9 #}
{%- if grains.os in ["Arch", "OpenBSD"] or grains.oscodename in ["openSUSE Tumbleweed"] %} {%- if grains.os in ["Arch", "OpenBSD"] or grains.get("oscodename", "") in ["openSUSE Tumbleweed"] %}
PubkeyAcceptedAlgorithms: "+ssh-rsa" PubkeyAcceptedAlgorithms: "+ssh-rsa"
{%- endif %} {%- endif %}