Skip to content

Commit

Permalink
fix: fix display version for nsclient v0.6.5 and newer (4 parts)
Browse files Browse the repository at this point in the history
  • Loading branch information
dafyddj committed Jan 20, 2025
1 parent d3073df commit c8c3b81
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nsclient.sls
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,17 @@

nsclient:
{%- for version in versions %}
{#- v0.5.x.x and later Windows display versions have only three parts (e.g. 0.5.2039) #}
{#- v0.5.x.x up to v0.6.4 Windows display versions have only three parts (e.g. 0.5.2039) #}
{#- v0.6.5 and newer have display versions similar to 0.6.5.000 #}
{%- if salt["pkg.compare_versions"](version, ">=", "0.5") %}
{%- set parts = version.split(".") %}
{%- set major, minor, patch = parts[:3] %}
{%- set build = parts[3]|d("0") %}
{%- set display_version = ".".join([major, minor, patch ~ build.zfill(3)]) %}
{%- if salt["pkg.compare_versions"](version, "<", "0.6.5") %}
{%- set display_version = ".".join([major, minor, patch ~ build.zfill(3)]) %}
{%- else %}
{%- set display_version = ".".join([major, minor, patch, build.zfill(3)]) %}
{%- endif %}
{%- endif %}

'{{ display_version|d(version) }}':
Expand Down

0 comments on commit c8c3b81

Please sign in to comment.