diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-25 13:31:21 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-25 13:31:21 -0400 |
commit | 9c603d8267c0a511968a8a553d7fa0b2d5bf9b73 (patch) | |
tree | c473a7615586dc22d585bda67e118ed2fe535754 /src/lib/Bcfg2/Server/Plugins/Packages | |
parent | 3dc289678812238c2fcc54098b1d8de9bf64f900 (diff) | |
download | bcfg2-9c603d8267c0a511968a8a553d7fa0b2d5bf9b73.tar.gz bcfg2-9c603d8267c0a511968a8a553d7fa0b2d5bf9b73.tar.bz2 bcfg2-9c603d8267c0a511968a8a553d7fa0b2d5bf9b73.zip |
Handle FAM monitor failures more gracefully:
* Where possible, create the file or directory that is about to be
monitored. This ensures that content can be added later without
need to restart Bcfg2. (Otherwise, adding the monitor would fail,
and so when you did create the file in question, bcfg2-server would
never be notified of it.)
* When not possible, give better error messages.
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Packages')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py b/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py index 739320cb0..ff57d57e8 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/PackagesSources.py @@ -16,6 +16,7 @@ class PackagesSources(Bcfg2.Server.Plugin.StructFile, each ``Source`` tag. """ __identifier__ = None + create = "Sources" def __init__(self, filename, cachepath, fam, packages, setup): """ @@ -39,14 +40,8 @@ class PackagesSources(Bcfg2.Server.Plugin.StructFile, If ``sources.xml`` cannot be read """ Bcfg2.Server.Plugin.Debuggable.__init__(self) - try: - Bcfg2.Server.Plugin.StructFile.__init__(self, filename, fam=fam, - should_monitor=True) - except OSError: - err = sys.exc_info()[1] - msg = "Packages: Failed to read configuration file: %s" % err - self.logger.error(msg) - raise Bcfg2.Server.Plugin.PluginInitError(msg) + Bcfg2.Server.Plugin.StructFile.__init__(self, filename, fam=fam, + should_monitor=True) #: The full path to the directory where #: :class:`Bcfg2.Server.Plugins.Packages.Source.Source` data |