{ "__inputs": [ { "name": "DS_YARDSTICK", "label": "yardstick", "description": "", "type": "datasource", "pluginId": "influxdb", "pluginName": "InfluxDB" } ], "__requires": [ { "type": "grafana", "id": "grafana", "name": "Grafana", "version": "4.4.3" }, { "type": "panel", "id": "graph", "name": "Graph", "version": "" }, { "type": "datasource", "id": "influxdb", "name": "InfluxDB", "version": "1.0.0" }, { "type": "panel", "id": "text", "name": "Text", "version": "" } ], "annotations": { "list": [] }, "editable": true, "gnetId": null, "graphTooltip": 0, "hideControls": false, "id": null, "links": [], "refresh": false, "rows": [ { "collapse": false, "height": "100px", "panels": [ { "content": "
The vPE handles packet processing, routing, QinQ encapsulation, flows, ACL rules, adds/removes MPLS tags and performs QoS
\nThe KPI is the number of packets per second for a specified packet size (min packet size is 68 byte) with an accepted minimal packet loss
\n::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: Copyright (c) 2018 Mirantis Inc., Enea AB and others.
:
: All rights reserved. This program and the accompanying materials
: are made available under the terms of the Apache License, Version 2.0
: which accompanies this distribution, and is available at
: http://www.apache.org/licenses/LICENSE-2.0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Sun, 03 Dec 2017 22:03:01 +0200
Subject: [PATCH] reclass.storage.node: Merge duplicate nodes
Reclass does not support duplicate nodes in top pillar, so merge all
nodes with the same name into a single node, inheriting classes from
all instances.
This allows using multiple "system.reclass.storage.system.*_cluster"
classes for the same node, based on re-using the name (hostname).
NOTE: defaults.merge module does not merge lists (e.g. for classes),
so handle that case separately.
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
diff --git a/reclass/storage/node.sls b/reclass/storage/node.sls
--- a/reclass/storage/node.sls
+++ b/reclass/storage/node.sls
@@ -1,7 +1,15 @@
{%- from "reclass/map.jinja" import storage with context %}
{%- if storage.enabled %}
+{%- set storage_by_name = {} %}
{%- for node_name, node in storage.get('node', {}).iteritems() %}
+{%- set new_node_name = node.get('name', node_name) %}
+{%- set new_node = storage_by_name.get(new_node_name, {'classes': []}) %}
+{%- do salt['defaults.merge'](node, {'classes': new_node.classes + node.classes}) %}
+{%- do salt['defaults.merge'](storage_by_name, {new_node_name: node}) %}
+{%- endfor %}
+
+{%- for node_name, node in storage_by_name.iteritems() %}
{%- if node.repeat is defined %}