diff options
-rw-r--r-- | schemas/base.xsd | 1 | ||||
-rw-r--r-- | schemas/bundle.xsd | 1 | ||||
-rw-r--r-- | schemas/pkglist.xsd | 1 | ||||
-rw-r--r-- | schemas/rules.xsd | 1 | ||||
-rw-r--r-- | schemas/services.xsd | 1 | ||||
-rw-r--r-- | src/lib/Server/Plugin.py | 8 |
6 files changed, 11 insertions, 2 deletions
diff --git a/schemas/base.xsd b/schemas/base.xsd index 5be582850..effb652f5 100644 --- a/schemas/base.xsd +++ b/schemas/base.xsd @@ -21,6 +21,7 @@ <xsd:element name='Group' type='ContainerType'/> </xsd:choice> <xsd:attribute name='name' type='xsd:string'/> + <xsd:attribute name='negate' type='xsd:string'/> </xsd:complexType> <xsd:element name='Base'> diff --git a/schemas/bundle.xsd b/schemas/bundle.xsd index e048063fa..685c7ca6f 100644 --- a/schemas/bundle.xsd +++ b/schemas/bundle.xsd @@ -21,6 +21,7 @@ <xsd:element name='Group' type='GroupType'/> </xsd:choice> <xsd:attribute type='xsd:string' name='name' use='required'/> + <xsd:attribute type='xsd:string' name='negate' use='required'/> </xsd:complexType> <xsd:element name='Bundle'> diff --git a/schemas/pkglist.xsd b/schemas/pkglist.xsd index 13d70646a..65c5435d0 100644 --- a/schemas/pkglist.xsd +++ b/schemas/pkglist.xsd @@ -29,6 +29,7 @@ <xsd:element name='Client' type='ContainerType'/> </xsd:choice> <xsd:attribute name='name' type='xsd:string'/> + <xsd:attribute name='negate' type='xsd:string'/> </xsd:complexType> <xsd:element name='PackageList'> diff --git a/schemas/rules.xsd b/schemas/rules.xsd index 31283b2eb..270b08828 100644 --- a/schemas/rules.xsd +++ b/schemas/rules.xsd @@ -52,6 +52,7 @@ <xsd:element name='Client' type='RContainerType'/> </xsd:choice> <xsd:attribute name='name' type='xsd:string'/> + <xsd:attribute name='negate' type='xsd:string'/> </xsd:complexType> diff --git a/schemas/services.xsd b/schemas/services.xsd index bdc2b8d41..14964c955 100644 --- a/schemas/services.xsd +++ b/schemas/services.xsd @@ -33,6 +33,7 @@ <xsd:element name='Client' type='ContainerType'/> </xsd:choice> <xsd:attribute name='name' type='xsd:string'/> + <xsd:attribute name='negate' type='xsd:string'/> </xsd:complexType> <xsd:element name='Services'> diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 8d944e7f8..2f23f76a5 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -187,8 +187,12 @@ class StructFile(XMLFileBacked): and not isinstance(item, lxml.etree._Comment)] for group in [item for item in worklist if item.tag == 'Group']: # if only python had forceable early-binding - newpred = eval("lambda x:'%s' in x.groups and predicate(x)" % (group.get('name')), - {'predicate':predicate}) + if group.get('negate', 'false') == 'true': + cmd = "lambda x:'%s' not in x.groups and predicate(x)" + else: + cmd = "lambda x:'%s' in x.groups and predicate(x)" + + newpred = eval(cmd % (group.get('name')), {'predicate':predicate}) work[newpred] = group.getchildren() def Match(self, metadata): |