<VerbNetworks> <autossh version="0.1.0"> <tunnels> <tunnel uuid="490829b9-f1b0-42ad-8dad-182de0c06afb"> <user>myuser</name> <host>panic.verbnetworks.com</type> </tunnel> </tunnels> </autossh></VerbNetworks>
{% for tunnel_uuid, tunnel_item in 'VerbNetworks.autossh.tunnels.tunnel'.iteritems() %}[autossh_{{ tunnel_uuid }}]{% endfor %}
{% for tunnel_uuid in helpers.getUUIDs('VerbNetworks.autossh.tunnels.tunnel') %}{% set tunnel = helpers.getUUID(tunnel_uuid) %}Host {{ tunnel_uuid }} User {{ tunnel.user }} HostName {{ tunnel.host }}{% endfor %}
{% if helpers.exists('VerbNetworks.autossh.tunnels.tunnel') %}{% for tunnel in helpers.toList('VerbNetworks.autossh.tunnels.tunnel') %}{{tunnel.user}} {{tunnel.host}}{% endfor %}{% endif %}
def getUUIDs(self, tag): """ retrieve a list of uuids from the item list returned by tag :param tag: tag in dot notation (section.item) :return: [] """ uuids = [] for item in self.toList(tag): for uuid in self._template_in_data['__uuid__']: if self._template_in_data['__uuid__'][uuid] == item: uuids.append(uuid) return uuids
return uuids
{{item['@uuid']}}