summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Client/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Bcfg2/Client/__init__.py')
-rw-r--r--src/lib/Bcfg2/Client/__init__.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/Bcfg2/Client/__init__.py b/src/lib/Bcfg2/Client/__init__.py
index 3cba93fff..433fb570a 100644
--- a/src/lib/Bcfg2/Client/__init__.py
+++ b/src/lib/Bcfg2/Client/__init__.py
@@ -12,9 +12,9 @@ import argparse
import tempfile
import Bcfg2.Logger
import Bcfg2.Options
-import XML # pylint: disable=W0403
-import Proxy # pylint: disable=W0403
-import Tools # pylint: disable=W0403
+from Bcfg2.Client import XML
+from Bcfg2.Client import Proxy
+from Bcfg2.Client import Tools
from Bcfg2.Utils import locked, Executor, safe_input
from Bcfg2.version import __version__
# pylint: disable=W0622
@@ -88,7 +88,6 @@ class Client(object):
options = Proxy.ComponentProxy.options + [
Bcfg2.Options.Common.syslog,
- Bcfg2.Options.Common.location,
Bcfg2.Options.Common.interactive,
Bcfg2.Options.BooleanOption(
"-q", "--quick", help="Disable some checksum verification"),
@@ -194,7 +193,11 @@ class Client(object):
ret = XML.Element("probe-data", name=name, source=probe.get('source'))
try:
scripthandle, scriptname = tempfile.mkstemp()
- script = os.fdopen(scripthandle, 'w')
+ if sys.hexversion >= 0x03000000:
+ script = os.fdopen(scripthandle, 'w',
+ encoding=Bcfg2.Options.setup.encoding)
+ else:
+ script = os.fdopen(scripthandle, 'w')
try:
script.write("#!%s\n" %
(probe.attrib.get('interpreter', '/bin/sh')))
@@ -666,13 +669,15 @@ class Client(object):
# first process prereq actions
for bundle in bundles[:]:
if bundle.tag == 'Bundle':
- bmodified = any(item in self.whitelist for item in bundle)
+ bmodified = any((item in self.whitelist or
+ item in self.modified) for item in bundle)
else:
bmodified = False
actions = [a for a in bundle.findall('./Action')
if (a.get('timing') in ['pre', 'both'] and
(bmodified or a.get('when') == 'always'))]
- # now we process all "always actions"
+ # now we process all "pre" and "both" actions that are either
+ # always or the bundle has been modified
if Bcfg2.Options.setup.interactive:
self.promptFilter(iprompt, actions)
self.DispatchInstallCalls(actions)