summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugin.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed problem with recent DirectoryBacked changes that caused a traceback on ↵Mike McCallister2011-07-261-3/+12
| | | | Properties initialization.
* Rewrote DirectoryBacked so it handles files contained in an arbitrary ↵Mike McCallister2011-07-261-37/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directory layout. Previously, DirectoryBacked (and as a result Bundler, Deps, Rules, Base, Pkgmgr, and others) only recognized XML files contained in the top-level plugin directory, for example: Deps/foo.xml Deps/subdir/foo.xml # <--- Ignored Bundler/bar.xml Bundler/subdir/baz.xml # <--- Ignored Now it can support the following as well: Deps/debian-lenny/foo.xml Deps/debian-squeeze/foo.xml Bundler/group-a/bar.xml Bundler/group-b/baz.xml Note that the directories and filenames do not factor into the semantic meaning of the configuration specification. The contents of foo.xml must stand alone, as if they were in the same single-level directory as before. In the case of Deps, Rules, Pkgmgr, and Svcmgr, you must use Groups and priorities within the XML files as needed to ensure that Bcfg2 can correctly resolve the configuration for your hosts. For example, prior to this change you would use a single file like the following: Deps/foo.xml: <Dependencies priority="0"> <Group name="debian-lenny"> <Package name="foo"> <Path name="/etc/foo.conf"/> </Package> </Group> <Group name="debian-squeeze"> <Package name="foo"> <Path name="/etc/foo.conf"/> <Path name="/etc/bar.conf"/> </Package> </Group> </Dependencies> Now you can use a pair of files in separate directories like the following. Note how the groups within each file prevent there from being two sources for a single package: Deps/debian-lenny/foo.xml: <Dependencies priority="0"> <Group name="debian-lenny"> <Package name="foo"> <Path name="/etc/foo.conf"/> </Package> </Group> </Dependencies> Deps/debian-squeeze/foo.xml: <Dependencies priority="0"> <Group name="debian-squeeze"> <Package name="foo"> <Path name="/etc/foo.conf"/> <Path name="/etc/bar.conf"/> </Package> </Group> </Dependencies> In the case of Bundler, individual filenames must remain unique throughout the directory hierarchy, and they must match the bundle name.
* Added docstring to explain what 'datastore' argument contains.Mike McCallister2011-07-231-0/+5
|
* Created a new method to return a sorted list of plugins by type.Mike McCallister2011-07-221-0/+5
| | | | | | | | | | | | | | | | | | | | Replaced many list comprehensions in Core.py with a new method named plugins_by_type(), which does the same thing with an added twist: this new method also sorts the list of plugins by a new field named sort_order. It also uses the name of the plugin where the sort_order values are the same. This lets us control the processing sequence of plugins that need to build on the results of a plugin that runs prior to them. The immediate example is Deps, which should run after Packages has generated the full list of packages to be installed. Prior to this commit, it was impossible to control the order in which they ran. A future commit will (hopefully) take advantage of this capability. This commit also splits the Core.validate_data() method into two: one for validate_structures() and one for validate_goals(), instead of passing in a base class and using if logic. This approach seemed a little clearer to me.
* made info.xml files understand <Path> tags to better set permissions on ↵Chris St. Pierre2011-07-191-11/+14
| | | | altsrc'd files
* prevent KeyErrors when directories get changed by rsyncTorsten Rehn2011-07-041-1/+1
| | | | This wasn't originally anticipated, but if a repository is updated via rsync, HandleEvent() receives 'changed' actions for directories as well. Directories aren't present in self.entries and consequently caused KeyErrors.
* New Info attribute: "sensitive"Holger Weiß2011-06-291-2/+4
| | | | | | The contents/diffs of <Path>s which are marked as "sensitive" are now omitted from the reports transmitted to the server, so that they won't end up in the statistics database.
* Handle :info file removalHolger Weiß2011-06-261-1/+1
| | | | | Handle the removal of :info files in the same way as the removal of info files (without leading colon) is handled.
* change error to debugChris St. Pierre2011-06-161-2/+1
|
* fixed bugs with handling of negate in new StructFile.Match()Chris St. Pierre2011-06-151-2/+4
|
* bug fixesChris St. Pierre2011-06-151-8/+12
|
* made StructFile.Match() work with Group/Client tags inside other tagsChris St. Pierre2011-06-151-43/+37
|
* PY3K: Finish server-side code fixesSol Jerome2011-06-141-0/+3
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Plugin: Fix nasty list comprehension bugSol Jerome2011-06-141-2/+2
| | | | | | | It appears as though Python 2 kept around variables assigned within a list comprehensions which caused this to go unnoticed. Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Plugins: Handle builtin file type for PY3KSol Jerome2011-05-031-2/+5
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Plugins: Fix import and indent errorsSol Jerome2011-04-261-0/+1
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Plugins: Add full PY3K compatibilitySol Jerome2011-04-261-9/+18
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* added Client tag to StructFile; made PropertyFile inherit from StructFileChris St. Pierre2011-04-141-11/+23
|
* PY3K + PEP8 fixes for remaining filesSol Jerome2011-04-071-1/+1
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Plugins: PY3K + PEP8 fixesSol Jerome2011-04-061-33/+69
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* EntrySet: Add generic ignore support for files named \*.genshi_include, ↵Narayan Desai2011-01-221-1/+1
| | | | enabling splitting of genshi templates (Resolves Ticket #897)
* Cfg: pull file permissions defaults uniformly (Resolves Ticket #958) (Patch ↵Narayan Desai2011-01-221-4/+4
| | | | from unidentified openid user)
* Plugin.Version: define parameters for commit_dataTim Laszlo2010-12-181-1/+1
|
* Plugin.py: Reverted broken regexTim Laszlo2010-10-211-2/+2
|
* web reports: new skinTim Laszlo2010-10-141-2/+2
|
* Some docstrings addedFabian Affolter2010-07-161-9/+15
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5967 ce84e21b-d406-0410-9b95-82705330c041
* Fix broken regex match for owner and mtimeTim Laszlo2010-07-081-2/+2
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5963 ce84e21b-d406-0410-9b95-82705330c041
* Add the ability to specify important entries via info/info.xmlSol Jerome2010-06-221-3/+8
| | | | | | | | | | | | We currently have 'important' entries specified only inside the code for various client tools. This provides no room for growing that list outside of adding things to the code itself. With this change, users can now specify important entries via an additional attribute in their info.xml files. Signed-off-by: Sol Jerome <sol.jerome@gmail.com> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5957 ce84e21b-d406-0410-9b95-82705330c041
* Updated files to match PEP 257 Fabian Affolter2010-06-211-67/+68
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5951 ce84e21b-d406-0410-9b95-82705330c041
* Slight change to error messageTim Laszlo2010-06-161-1/+1
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5943 ce84e21b-d406-0410-9b95-82705330c041
* Reduce select timeouts to 2sTim Laszlo2010-06-161-1/+1
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5942 ce84e21b-d406-0410-9b95-82705330c041
* ThreadedStatistics: load/save data on startup/shutdownTim Laszlo2010-06-161-4/+82
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5941 ce84e21b-d406-0410-9b95-82705330c041
* Added ThreadedStatistics plugin class. Migrated DBStats to use ↵Tim Laszlo2010-06-071-0/+31
| | | | | | ThreadedStatistics. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5889 ce84e21b-d406-0410-9b95-82705330c041
* Core: Allow the specification of plugin conflicts (Fix for Ticket #875)Sol Jerome2010-04-241-0/+1
| | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu>
* Fix traceback in bcfg2-admin init by using os.makedirs()Sol Jerome2010-02-051-11/+1
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5713 ce84e21b-d406-0410-9b95-82705330c041
* Plugin.py: Fix docstring for GroupSpoolSol Jerome2010-01-081-1/+1
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5667 ce84e21b-d406-0410-9b95-82705330c041
* Info: Fix regex for paranoid options in info files [bugfix]Sol Jerome2009-12-211-1/+1
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5629 ce84e21b-d406-0410-9b95-82705330c041
* Plugin: add a per-plugin runtime debugging infrastructureNarayan Desai2009-11-201-1/+9
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5585 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Remove support for old-style posix entriesSol Jerome2009-11-191-3/+0
| | | | | | | | | | | This commit forces the user to specify <Path> entries on the server side while still maintaining compatibility with old clients via the POSIXCompat plugin. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5582 ce84e21b-d406-0410-9b95-82705330c041
* Plugin.py: Fix Cfg conflicts (Reported by Thorsten Lockert on irc)Sol Jerome2009-11-191-1/+1
| | | | | | | | | Since a Path can now be a file/directory/other type, we need to make sure that we only bind files for Cfg entries. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5581 ce84e21b-d406-0410-9b95-82705330c041
* Fix function name in Metadata baseclassNarayan Desai2009-10-221-1/+1
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5492 ce84e21b-d406-0410-9b95-82705330c041
* Pylint/PEP 8 Code cleanupsSol Jerome2009-10-071-16/+16
| | | | | | Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5477 ce84e21b-d406-0410-9b95-82705330c041
* Fix nasty core hang, which would manifest itself as a lockup upon shutdown ↵Narayan Desai2009-10-021-0/+4
| | | | | | | | | | | | | | | | | | | for bcfg2-{server,info,admin} The root cause of this issue was our use of external threads. Without a channel for data requesting plugin (and hence thread) shutdown, plugin threads would continue, unabated, forever. This would cause the python interpreter to hang forever waiting for a futex. Added a new shutdown method to Bcfg2.Server.Plugin.Plugin which sets a state flag upon shutdown request. Plugin threads must cycle periodically, even if no work is available, to ensure that the shutdown flag is honored in a reasonable amount of time. Also, the shutdown method is triggered using atexit. This means that scripts may need to explicitly sys.exit or raise SystemExit, depending on circumstances. This addresses at least one, but probably more tickets, however I am currently offline. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5472 ce84e21b-d406-0410-9b95-82705330c041
* POSIX: Add support for unified Path entriesSol Jerome2009-09-071-0/+3
| | | | | | | | | | | This commit adds support for a new Path entry which unifies all the various POSIX entry types. A new plugin is included which will allow you to transform new Path entries back into their old format (for compatibility with old clients). Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5414 ce84e21b-d406-0410-9b95-82705330c041
* Fix FileBacked class to catch created files againNarayan Desai2009-07-161-1/+1
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5342 ce84e21b-d406-0410-9b95-82705330c041
* FileCaching: only process file updates on exists and changed events (should ↵Narayan Desai2009-07-161-1/+3
| | | | | | cut down on unneeded and expensive startup ops) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5335 ce84e21b-d406-0410-9b95-82705330c041
* bcfg2-admin init: fix traceback (reported by somekool on irc)Narayan Desai2009-07-131-9/+14
| | | | | | Apparently classmethods aren't callable from subclasses if overridden git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5322 ce84e21b-d406-0410-9b95-82705330c041
* Plugin.py: Add configurable metadata settings to bcfg2.conf (ticket #680)Sol Jerome2009-07-011-7/+26
| | | | | | | | | | The default settings for ConfigFile metadata were previously hardcoded in Plugin.py. This change enables setting global user-specified defaults in the [mdata] section of bcfg2.conf. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5308 ce84e21b-d406-0410-9b95-82705330c041
* Changed how bcfg2-admin init handles plugins and added update_client to ↵James Yang2009-06-301-0/+11
| | | | | | metadata for changes in 5305 git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5306 ce84e21b-d406-0410-9b95-82705330c041
* Cfg: Fix hardwired filename ignores (Fixes Ticket #619)Narayan Desai2009-06-141-1/+1
| | | | git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5280 ce84e21b-d406-0410-9b95-82705330c041