Commit 7d071b8e authored by Antoine Millet's avatar Antoine Millet
Browse files

Implemented nic_vlans tag

parent 0d0acc6d
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@




import logging
import logging
import itertools
from functools import wraps
from functools import wraps
from xml.etree import cElementTree as et
from xml.etree import cElementTree as et
from StringIO import StringIO
from StringIO import StringIO
@@ -197,6 +198,15 @@ def nic(dom):
    return u' '.join(map(str, xrange(len(dom.nics)))) or None
    return u' '.join(map(str, xrange(len(dom.nics)))) or None




@ttl(10)
@refresh(10)
@_vir_tag
def nic_vlans(dom):
    """VM network interfaces."""
    vlans = set(itertools.chain(*[x.vlans for x in dom.nics]))
    return u' '.join(str(x) for x in sorted(vlans)) or None


@refresh(10)
@refresh(10)
@_vir_tag
@_vir_tag
def autostart(dom):
def autostart(dom):