summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2014-11-25 17:56:16 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2014-11-25 17:57:04 +0100
commitd4ae5e04739d9a8e0732dd35ee28c14b0ff96957 (patch)
treeef161f9a56426122f547794010ef34ae40b4a2cd
parent84b180e2fddcb5563adca33ed6feb3fd991dfde2 (diff)
downloadbcfg2-d4ae5e04739d9a8e0732dd35ee28c14b0ff96957.tar.gz
bcfg2-d4ae5e04739d9a8e0732dd35ee28c14b0ff96957.tar.bz2
bcfg2-d4ae5e04739d9a8e0732dd35ee28c14b0ff96957.zip
Bundler: modification is now the boolean inherit_modification
-rw-r--r--doc/server/plugins/structures/bundler/index.txt9
-rw-r--r--schemas/bundle.xsd9
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Bundler.py7
-rw-r--r--testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestBundler.py4
4 files changed, 12 insertions, 17 deletions
diff --git a/doc/server/plugins/structures/bundler/index.txt b/doc/server/plugins/structures/bundler/index.txt
index e6a9cf345..e8f609e09 100644
--- a/doc/server/plugins/structures/bundler/index.txt
+++ b/doc/server/plugins/structures/bundler/index.txt
@@ -164,7 +164,8 @@ RequiredBundle tag that adds another bundle by name, e.g.:
The dependent bundle is added to the list of bundles sent to the
client, *not* to the parent bundle itself. If you want to propagate
the modification flag from the required bundle, you can add
-``modification="inherit"`` to the RequiredBundle tag. An example:
+``inherit_modification="true"`` to the RequiredBundle tag.
+An example:
``nfs-client.xml``:
@@ -193,13 +194,13 @@ the modification flag from the required bundle, you can add
If a new ``nfs-utils`` package was installed, the ``nfslock``,
``rpcbind``, and ``nfs`` services would be restarted, but *not* the
-``autofs`` service. If you would add ``modification="inherit`` to
-the RequiredBundle tag, you would ensure the propagation of the
+``autofs`` service. If you would add ``inherit_modification="true"``
+to the RequiredBundle tag, you would ensure the propagation of the
modification flag and the ``autofs`` service would be restarted,
too. But if a new ``/etc/auto.misc`` file was sent out, *only* the
``autofs`` service would be restarted, but the ``nfslock``,
``rpcbind``, and ``nfs`` services would not be restarted
-(independent of the ``modification`` flag).
+(independent of the ``inherit_modification`` flag).
Altsrc
======
diff --git a/schemas/bundle.xsd b/schemas/bundle.xsd
index b6f9e00af..4a11a1d1b 100644
--- a/schemas/bundle.xsd
+++ b/schemas/bundle.xsd
@@ -307,13 +307,6 @@
<xsd:attributeGroup ref="py:genshiAttrs"/>
</xsd:complexType>
- <xsd:simpleType name='ModificationTypeEnum'>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="ignore"/>
- <xsd:enumeration value="inherit"/>
- </xsd:restriction>
- </xsd:simpleType>
-
<xsd:complexType name='RequiredBundleType'>
<xsd:attribute type='xsd:string' name='name' use='required'>
<xsd:annotation>
@@ -322,7 +315,7 @@
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
- <xsd:attribute type='ModificationTypeEnum' name='modification'>
+ <xsd:attribute type='xsd:boolean' name='inherit_modification'>
<xsd:annotation>
<xsd:documentation>
Specify how to handle modifications in the required
diff --git a/src/lib/Bcfg2/Server/Plugins/Bundler.py b/src/lib/Bcfg2/Server/Plugins/Bundler.py
index 4945bf85b..6c35ada59 100644
--- a/src/lib/Bcfg2/Server/Plugins/Bundler.py
+++ b/src/lib/Bcfg2/Server/Plugins/Bundler.py
@@ -130,15 +130,16 @@ class Bundler(Plugin,
if child.get("name") not in bundles_added:
bundles.append(child.get("name"))
bundles_added.add(child.get("name"))
- if child.get('modification', 'ignore') == 'inherit':
+ if child.get('inherit_modification', 'false') == 'true':
if metadata.version_info >= \
Bcfg2VersionInfo('1.4.0pre2'):
lxml.etree.SubElement(data, 'Bundle',
name=child.get('name'))
else:
self.logger.warning(
- 'Bundler: modification="inherit" is only '
- 'supported for clients starting 1.4.0pre2')
+ 'Bundler: inherit_modification="true" is '
+ 'only supported for clients starting '
+ '1.4.0pre2')
data.remove(child)
else:
# no name -- wat
diff --git a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestBundler.py b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestBundler.py
index db2a91227..1bf208c3e 100644
--- a/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestBundler.py
+++ b/testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestBundler.py
@@ -77,7 +77,7 @@ class TestBundler(TestPlugin, TestStructure, TestXMLDirectoryBacked):
has_dep = lxml.etree.Element("Bundle")
lxml.etree.SubElement(has_dep, "RequiredBundle", name="is_dep")
lxml.etree.SubElement(has_dep, "RequiredBundle", name="is_mod_dep",
- modification="inherit")
+ inherit_modification="true")
lxml.etree.SubElement(has_dep, "Package", name="foo")
b.bundles['has_dep'].XMLMatch.return_value = has_dep
expected['has_dep'] = lxml.etree.Element("Bundle", name="has_dep")
@@ -124,7 +124,7 @@ class TestBundler(TestPlugin, TestStructure, TestXMLDirectoryBacked):
has_dep = lxml.etree.Element("Bundle")
lxml.etree.SubElement(has_dep, "RequiredBundle", name="is_dep")
lxml.etree.SubElement(has_dep, "RequiredBundle", name="is_mod_dep",
- modification="inherit")
+ inherit_modification="true")
lxml.etree.SubElement(has_dep, "Package", name="foo")
b.bundles['has_dep'].XMLMatch.return_value = has_dep
expected['has_dep'] = lxml.etree.Element("Bundle", name="has_dep")