summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* bcfg2-lint: Update schema with new vcs valuesSol Jerome2011-07-311-1/+2
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* bcfg2-lint RequiredAttrs plugin checks for text content of "file" PathsChris St. Pierre2011-07-281-0/+7
|
* added write() method to Properties to write back persistent changesChris St. Pierre2011-07-271-4/+43
|
* 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-262-39/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update to Deps to eliminate "Failed to add dep entry for <built-in function ↵Mike McCallister2011-07-251-1/+6
| | | | | | | | Comment>:None" warning. Comments in the Deps file (inside a Package element) will cause the above error. In generating the prerequisites, we can eliminate this by looking for callable() items and excluding them.
* Added docstring to explain what 'datastore' argument contains.Mike McCallister2011-07-231-0/+5
|
* Treat Bound entries like unbound entries for calculating prerequisites in Deps.Mike McCallister2011-07-231-5/+7
|
* Refactor the validate_structure() method into two.Mike McCallister2011-07-231-25/+45
| | | | | | | | | | | | | New method named calculate_prereqs() handles pre-req calculation. Existing validate_structure() method now only handles memoization of the prereqs and use of the prereqs to update the configuration. Also added a sort_order value to cause this plugin to run after Packages, so we can use Deps to add dependencies to implicitly added Packages. NOTE: This doesn't work yet, as Packages adds BoundPackage entries, and Deps doesn't yet realize they are equivalent to the Package entries it knows about. This will be fixed in a future commit.
* Created a new method to return a sorted list of plugins by type.Mike McCallister2011-07-223-41/+60
| | | | | | | | | | | | | | | | | | | | 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.
* Fixed to accommodate changes made to Plugin.py in changeset ↵Mike McCallister2011-07-221-3/+4
| | | | | | | | | | | 3291a875339a7e5569d4. The changes to the INode.Match() function in changeset 3291a875339a7e5569d4 caused breakage in the Deps plugin, as it inherits from INode. This commit adjusts the definition of the predicate function in Deps.py to mirror the changes made to INode in Plugin.py, eliminating the error about the wrong number of parameters being passed to the lambda function.
* Chkconfig: Use LANG=C to avoid locale conflicts (Resolves #1028 and #926)Sol Jerome2011-07-221-0/+3
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* bcfg2-admin: Revert some changes that are not py3k compatibleSol Jerome2011-07-213-5/+10
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Miscellaneous bcfg2-admin bug fixes:Chris St. Pierre2011-07-213-36/+33
| | | | | | * Fixed mode argument parsing when a config file is supplied * Fixed loading help messages when Reports is not configured * Improved option parsing; used Bcfg2.Options.OptionParser
* as per http://trac.mcs.anl.gov/projects/bcfg2/ticket/1026Josh Koenig2011-07-201-1/+1
| | | | piping stderr to /dev/null to prevent failure
* scrub password from error messagesChris St. Pierre2011-07-191-4/+3
|
* made info.xml files understand <Path> tags to better set permissions on ↵Chris St. Pierre2011-07-191-11/+14
| | | | altsrc'd files
* fixed output from ohai plugin when ohai not installedChris St. Pierre2011-07-151-1/+0
|
* added Genshi template syntax checker, other misc. bcfg2-lint cleanupChris St. Pierre2011-07-1410-16/+62
|
* made ohai plugin fail gracefully on machines without ohai installedChris St. Pierre2011-07-111-2/+12
|
* Revert "Add Environment.py file for building classes to gather env data."Sol Jerome2011-07-071-37/+0
| | | | | | | | This reverts commit 146a7a633bc3a36de21f589af0eec10755b0cae5. We don't really need this since we have already solved the version bits using sys.hexversion where needed. Also, this won't work on python3, so we won't be able to use it there.
* Merge remote-tracking branch 'upstream/master'Raul Cuza2011-07-071-3/+1
|\
| * bcfg2-admin viz: Remove --raw from documentationHolger Weiß2011-07-061-3/+1
| | | | | | | | | | | | Remove the --raw option from the "bcfg2-admin viz" documentation. The option has been superseeded by the --outfile option which allows for specifying arbitrary output types since commit 476cb9ac76.
* | Add Environment.py file for building classes to gather env data.Raul Cuza2011-07-061-0/+37
|/ | | | | | Includes Pyversion() class which simplifies getting the Python version that Bcfg2 is running under. It is mostly useful for Python 2 and under, since Python 3 has the handy sys.version_info.{major,minor,...} object.
* Merge branch 'remove-generators-info' of https://github.com/weiss/bcfg2Sol Jerome2011-07-061-7/+0
|\
| * bcfg2-info: Remove "generators" commandHolger Weiß2011-07-061-7/+0
| | | | | | | | | | | | | | The command "bcfg2-info generators" didn't spit out anything useful, just an unexpanded $Id$ keyword for each of the current generators. It's been that way for quite some time now, and nobody seemed to miss the command.
* | Display bcfg2-admin viz parameter errors on stdout instead of syslog.Mike McCallister2011-07-051-1/+1
| | | | | | | | | | Also switched to use __longhelp__ instead of __shorthelp__, as __shorthelp__ isn't actually very helpful.
* | Enhanced bcfg2-admin viz to allow output to be limited to one client.Mike McCallister2011-07-052-21/+48
|/ | | | | | | | | | By default, bcfg2-admin viz creates a diagram that shows the complete contents of the repository: all Groups, Bundles, and (optionally) Hosts/Clients. In a complicated configuration, this can be an overwhelming amount of information. This change adds an --only-client option that can be used to limit the elements on the diagram to those that apply to the named host.
* bcfg2-admin compare: Another few print() cleanupsHolger Weiß2011-07-061-7/+9
| | | | Indent all output in a consistent way.
* bcfg2-admin compare -r: Check for removed filesHolger Weiß2011-07-051-0/+6
| | | | | When the "-r" flag is used, check for files which are present in the old directory but not in the new directory (not just the other way round).
* bcfg2-admin compare -r: Clean up the outputHolger Weiß2011-07-051-4/+4
| | | | Fix the messages which are spit out when the "-r" flag is used.
* bcfg2-admin compare: Some code cleanupsHolger Weiß2011-07-051-16/+12
| | | | ... in the compareSpecifications() method.
* bcfg2-admin compare: Check for removed bundlesHolger Weiß2011-07-051-0/+5
| | | | | Check for bundles specified in the old configuration but not in the new configuration (not just the other way round).
* bcfg2-admin compare: Handle all <Independent> tagsHolger Weiß2011-07-051-6/+5
| | | | | If the configuration specifications contain multiple <Independent> tags, compare all of them, not only the first one.
* bcfg2-admin compare: Straighten the outputHolger Weiß2011-07-051-44/+36
| | | | | Iterate only once over the entries of a bundle and print a single two-line message for each differing or missing entry.
* bcfg2-admin compare: Don't edit list in for loopHolger Weiß2011-07-051-4/+6
| | | | | Removing elements from a list while iterating over it (forwards) leads to unexpected results.
* bcfg2-admin compare: Fix check if tag is knownHolger Weiß2011-07-051-1/+1
| | | | | The if statement which checks whether a given tag is known was declared the wrong way round.
* bcfg2-admin compare: Handle POSIX <Path> entriesHolger Weiß2011-07-051-8/+14
| | | | | | | | Let "bcfg2-admin compare" handle POSIX <Path> tags instead of the old-style entries. While at it, add support for all attributes which might show up in configuration specifications.
* bcfg2-admin compare: Actually do somethingHolger Weiß2011-07-051-0/+1
| | | | | The __call__() method now calls self.compareSpecifications() instead of effectively doing nothing.
* 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.
* Remove useless parenthesesHolger Weiß2011-06-301-4/+4
|
* Statistics: Abort if "sensitive" files are pulledHolger Weiß2011-06-301-1/+3
| | | | | | Let the Statistics plugin raise a PluginExecutionError if a "sensitive" entry is requested by "bcfg2-admin pull". This is how the DBStats plugin behaves already.
* DBStats: Bump internal database versionHolger Weiß2011-06-301-0/+4
| | | | | The internal database version must be incremented due to the new "is_sensitive" column.
* bcfg2-admin: Fix traceback when help argument omittedSol Jerome2011-06-292-3/+4
| | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Merge branch 'catch-exceptions' of https://github.com/weiss/bcfg2Sol Jerome2011-06-291-74/+99
|\
| * bcfg2-reports: Catch "--badentry=/tmp/nonexistent"Holger Weiß2011-06-301-36/+48
| | | | | | | | | | Catch I/O errors which might occur while reading a file specified as argument to --badentry, --extraentry, or --modifiedentry.
| * bcfg2-reports: Catch getopt exceptionsHolger Weiß2011-06-291-38/+51
| | | | | | | | | | On getopt errors, print a proper usage message instead of spitting out a traceback.
* | New database field: "is_sensitive"Holger Weiß2011-06-295-12/+26
| | | | | | | | | | | | The new "entry.reason.is_sensitive" flag indicates whether the file contents/diffs were omitted from the database due to the "sensitive" <Path> attribute.
* | New Info attribute: "sensitive"Holger Weiß2011-06-294-9/+20
|/ | | | | | 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.
* Merge branch 'master' of git.mcs.anl.gov:/bcfg2Sol Jerome2011-06-261-7/+6
|\