summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server/Plugin.py')
-rw-r--r--src/lib/Server/Plugin.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py
index d882c475f..9b3c5814f 100644
--- a/src/lib/Server/Plugin.py
+++ b/src/lib/Server/Plugin.py
@@ -5,7 +5,6 @@ import copy
import logging
import lxml.etree
import os
-import os.path
import pickle
import posixpath
import re
@@ -1190,6 +1189,7 @@ class SimpleConfig(FileBacked,
filename = os.path.join(plugin.data, plugin.name.lower() + ".conf")
self.plugin = plugin
self.fam = self.plugin.core.fam
+ self.read_files = set()
Bcfg2.Server.Plugin.FileBacked.__init__(self, filename)
ConfigParser.SafeConfigParser.__init__(self)
@@ -1201,7 +1201,7 @@ class SimpleConfig(FileBacked,
""" Build local data structures """
for section in self.sections():
self.remove_section(section)
- self.read(self.name)
+ self.read_files.update(self.read(self.name))
def get(self, section, option, **kwargs):
""" convenience method for getting config items """
@@ -1233,3 +1233,11 @@ class SimpleConfig(FileBacked,
return default
else:
raise
+
+ @property
+ def loaded(self):
+ if os.path.exists(self.name):
+ return self.name in self.read_files
+ else:
+ return True
+