summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/CfgPublicKeyCreator.py4
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgPublicKeyCreator.py b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgPublicKeyCreator.py
index 3f2d1030b..a6cb19cff 100644
--- a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgPublicKeyCreator.py
+++ b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgPublicKeyCreator.py
@@ -8,7 +8,7 @@ import tempfile
import lxml.etree
from Bcfg2.Utils import Executor
from Bcfg2.Server.Plugin import StructFile, PluginExecutionError
-from Bcfg2.Server.Plugins.Cfg import CfgCreator, CfgCreationError, get_cfg
+from Bcfg2.Server.Plugins.Cfg import CfgCreator, CfgCreationError
class CfgPublicKeyCreator(CfgCreator, StructFile):
@@ -33,8 +33,6 @@ class CfgPublicKeyCreator(CfgCreator, StructFile):
def __init__(self, fname):
CfgCreator.__init__(self, fname)
StructFile.__init__(self, fname)
- self.cfg = get_cfg()
- self.core = self.cfg.core
self.cmd = Executor()
def create_data(self, entry, metadata):
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
index dae03144a..44d980967 100644
--- a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
+++ b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
@@ -306,6 +306,8 @@ class CfgCreator(CfgBaseFileMatcher):
.. autoattribute:: Bcfg2.Server.Plugins.Cfg.CfgInfo.__specific__
"""
CfgBaseFileMatcher.__init__(self, fname, None)
+ self.cfg = get_cfg()
+ self.core = self.cfg.core
def create_data(self, entry, metadata):
""" Create new data for the given entry and write it to disk
@@ -391,6 +393,7 @@ class CfgCreator(CfgBaseFileMatcher):
try:
open(fileloc, 'wb').write(data)
+ self.core.block_for_fam_events()
except IOError:
err = sys.exc_info()[1]
raise CfgCreationError("Could not write %s: %s" % (fileloc, err))