summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Packages/PackagesSources.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-04 10:56:29 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-05-04 11:13:53 -0400
commit8bc23e6ed36a435cfbab927c64487115efa33bf2 (patch)
treee96978b7dffa8a7aa703e458d43b50012f2aae06 /src/lib/Server/Plugins/Packages/PackagesSources.py
parent7f64eae09fc93c37aaf90c511e7db5a56f0ba08a (diff)
downloadbcfg2-8bc23e6ed36a435cfbab927c64487115efa33bf2.tar.gz
bcfg2-8bc23e6ed36a435cfbab927c64487115efa33bf2.tar.bz2
bcfg2-8bc23e6ed36a435cfbab927c64487115efa33bf2.zip
better support for re-reading packages.conf (and SimpleConfigs in general)
Diffstat (limited to 'src/lib/Server/Plugins/Packages/PackagesSources.py')
-rw-r--r--src/lib/Server/Plugins/Packages/PackagesSources.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/Server/Plugins/Packages/PackagesSources.py b/src/lib/Server/Plugins/Packages/PackagesSources.py
index da79c00e9..e03303d30 100644
--- a/src/lib/Server/Plugins/Packages/PackagesSources.py
+++ b/src/lib/Server/Plugins/Packages/PackagesSources.py
@@ -35,7 +35,6 @@ class PackagesSources(Bcfg2.Server.Plugin.SingleXMLFileBacked,
(self.cachepath, err))
self.pkg_obj = packages
self.parsed = set()
- self.loaded = False
def toggle_debug(self):
Bcfg2.Server.Plugin.Debuggable.toggle_debug(self)
@@ -47,10 +46,13 @@ class PackagesSources(Bcfg2.Server.Plugin.SingleXMLFileBacked,
if event.filename != self.name:
self.parsed.add(os.path.basename(event.filename))
- if sorted(list(self.parsed)) == sorted(self.extras):
+ if self.config.loaded and self.loaded:
self.logger.info("Reloading Packages plugin")
self.pkg_obj.Reload()
- self.loaded = True
+
+ @property
+ def loaded(self):
+ return sorted(list(self.parsed)) == sorted(self.extras)
def Index(self):
Bcfg2.Server.Plugin.SingleXMLFileBacked.Index(self)