Merge upstream version
Related-PROD: PROD-28199
Change-Id: I5d9dbde1c3ac577fb30fa5d6b1ff18bcee28a0d7
diff --git a/templates/pkg_versions_csv.j2 b/templates/pkg_versions_csv.j2
new file mode 100644
index 0000000..c754f63
--- /dev/null
+++ b/templates/pkg_versions_csv.j2
@@ -0,0 +1,23 @@
+{% macro package_list(pkg_dict, id_label) %}
+ {% for pkg_name in pkg_dict | get_sorted_keys %}
+ {% set p = pkg_dict[pkg_name] %}
+ {% for status in p['results'].keys() | sort(reverse=true) %}
+ {% for action in p['results'][status].keys() | sort(reverse=true) %}
+ {% for node in p['results'][status][action].keys() | sort %}
+ {% set nd = p['results'][status][action][node] %}
+{{ id_label }},{{ pkg_name }},{{ node }},{{ status | make_status_label }},{{ action | make_action_label }},{{ nd['i'].version }},{{ nd['c'].version }},{{ p['r'].version }}
+ {% endfor %}
+ {% endfor %}
+ {% endfor %}
+ {% endfor %}
+ {{ caller() }}
+{% endmacro %}
+type,package_name,node,status,action,installed,candidate,release
+{% call package_list(critical, "mirantis") %}
+{% endcall %}
+{% call package_list(system, "system") %}
+{%- endcall %}
+{% call package_list(other, "other") %}
+{%- endcall %}
+{% call package_list(unlisted, "unlisted") %}
+{%- endcall %}