diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2013-03-21 09:36:34 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2013-03-21 09:36:34 -0500 |
commit | 7d22e7fe4bff3c229ed0cb8d3a792e508ba13cce (patch) | |
tree | 54d1dfc689ef0e4bc0d0c178c45e3fd55901d77a | |
parent | 98ef06e6a0426958f476f2835839aea5de3f7bc6 (diff) | |
parent | 5feb76d97c6b26228dcf521659f434c6b576310c (diff) | |
download | bcfg2-7d22e7fe4bff3c229ed0cb8d3a792e508ba13cce.tar.gz bcfg2-7d22e7fe4bff3c229ed0cb8d3a792e508ba13cce.tar.bz2 bcfg2-7d22e7fe4bff3c229ed0cb8d3a792e508ba13cce.zip |
Merge branch 'maint'
-rw-r--r-- | .travis.yml | 3 | ||||
-rw-r--r-- | debian/bcfg2-server.install | 1 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | doc/conf.py | 2 | ||||
-rw-r--r-- | doc/server/plugins/version/git.txt | 6 | ||||
-rw-r--r-- | misc/bcfg2-selinux.spec | 7 | ||||
-rw-r--r-- | misc/bcfg2.spec | 13 | ||||
-rw-r--r-- | osx/Makefile | 4 | ||||
-rw-r--r-- | osx/macports/Portfile | 2 | ||||
-rw-r--r-- | redhat/VERSION | 2 | ||||
-rw-r--r-- | redhat/bcfg2.spec.in | 3 | ||||
-rwxr-xr-x | setup.py | 2 | ||||
-rw-r--r-- | solaris/Makefile | 2 | ||||
-rw-r--r-- | solaris/pkginfo.bcfg2 | 2 | ||||
-rw-r--r-- | solaris/pkginfo.bcfg2-server | 2 | ||||
-rw-r--r-- | src/lib/Bcfg2/Client/Tools/YUM.py | 12 | ||||
-rw-r--r-- | src/lib/Bcfg2/Logger.py | 6 | ||||
-rw-r--r-- | src/lib/Bcfg2/Reporting/templates/base.html | 2 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Admin/Init.py | 1 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/FileMonitor/Inotify.py | 4 | ||||
-rw-r--r-- | src/lib/Bcfg2/version.py | 2 | ||||
-rwxr-xr-x | src/sbin/bcfg2-reports | 12 | ||||
-rw-r--r-- | testsuite/Testsrc/test_code_checks.py | 12 | ||||
-rwxr-xr-x | tools/upgrade/1.3/migrate_perms_to_mode.py | 18 |
24 files changed, 78 insertions, 48 deletions
diff --git a/.travis.yml b/.travis.yml index f93ab07c8..d0476c3c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,9 +23,8 @@ script: - nosetests testsuite branches: except: - - maint + - maint-1.2 - 1.1.0-stable - - py3k notifications: email: chris.a.st.pierre@gmail.com irc: diff --git a/debian/bcfg2-server.install b/debian/bcfg2-server.install index 91b1b2aef..533ca2e43 100644 --- a/debian/bcfg2-server.install +++ b/debian/bcfg2-server.install @@ -1,6 +1,7 @@ debian/bcfg2-server.default usr/share/bcfg2 debian/tmp/usr/bin/bcfg2-* usr/sbin debian/tmp/usr/lib/python*/*-packages/Bcfg2/Server/* +debian/tmp/usr/lib/python*/*-packages/Bcfg2/Reporting/* debian/tmp/usr/share/bcfg2/Hostbase/* debian/tmp/usr/share/bcfg2/schemas/* debian/tmp/usr/share/bcfg2/xsl-transforms/* diff --git a/debian/changelog b/debian/changelog index f7c3b0474..298e695c5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +bcfg2 (1.3.1-0.0) unstable; urgency=low + + * New upstream release + + -- Sol Jerome <sol.jerome@gmail.com> Thu, 21 Mar 2013 09:32:16 -0500 + bcfg2 (1.3.0-0.0) unstable; urgency=low * New upstream release diff --git a/doc/conf.py b/doc/conf.py index a1bceb1b1..d3d30687b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -66,7 +66,7 @@ else: # The short X.Y version. version = '1.3' # The full version, including alpha/beta/rc tags. -release = '1.3.0' +release = '1.3.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/server/plugins/version/git.txt b/doc/server/plugins/version/git.txt index 3f7ab9d9b..64ff422ca 100644 --- a/doc/server/plugins/version/git.txt +++ b/doc/server/plugins/version/git.txt @@ -13,12 +13,6 @@ reporting purposes. Once the plugin is enabled, every time a client checks in, it will include the current repository revision in the reports/statistics. -As with the other Version plugins, the Git plugin enables you to get -revision information out of your repository for reporting -purposes. Once the plugin is enabled, every time a client checks in, -it will include the current repository revision in the -reports/statistics. - Additionally, if the ``GitPython`` library is installed, the Git plugin exposes an additional XML-RPC method call, ``Git.Update``. With no arguments, ``Git.Update`` updates the working copy to the diff --git a/misc/bcfg2-selinux.spec b/misc/bcfg2-selinux.spec index 59718a2de..4c05f4959 100644 --- a/misc/bcfg2-selinux.spec +++ b/misc/bcfg2-selinux.spec @@ -8,8 +8,8 @@ %global selinux_variants %([ -z "%{selinux_types}" ] && echo mls strict targeted || echo %{selinux_types}) Name: bcfg2-selinux -Version: 1.3.0 -Release: 0.0 +Version: 1.3.1 +Release: 1 Summary: Bcfg2 Client and Server SELinux policy %if 0%{?suse_version} @@ -120,6 +120,9 @@ if [ $1 -eq 0 ] ; then fi %changelog +* Thu Mar 21 2013 Sol Jerome <sol.jerome@gmail.com> 1.3.1-1 +- New upstream release + * Fri Mar 15 2013 Sol Jerome <sol.jerome@gmail.com> 1.3.0-0.0 - New upstream release diff --git a/misc/bcfg2.spec b/misc/bcfg2.spec index 40fb787a3..ece69eda5 100644 --- a/misc/bcfg2.spec +++ b/misc/bcfg2.spec @@ -5,8 +5,8 @@ %{!?_initrddir: %global _initrddir %{_sysconfdir}/rc.d/init.d} Name: bcfg2 -Version: 1.3.0 -Release: 0.0 +Version: 1.3.1 +Release: 1 Summary: Configuration management system %if 0%{?suse_version} @@ -87,7 +87,7 @@ deployment strategies. This package includes the Bcfg2 client software. %package server -Version: 1.3.0 +Version: 1.3.1 Summary: Bcfg2 Server %if 0%{?suse_version} Group: System/Management @@ -140,7 +140,7 @@ deployment strategies. This package includes the Bcfg2 server software. %package server-cherrypy -Version: 1.3.0 +Version: 1.3.1 Summary: Bcfg2 Server - CherryPy backend %if 0%{?suse_version} Group: System/Management @@ -220,7 +220,7 @@ deployment strategies. This package includes the Bcfg2 documentation. %package web -Version: 1.3.0 +Version: 1.3.1 Summary: Bcfg2 Web Reporting Interface %if 0%{?suse_version} Group: System/Management @@ -454,6 +454,9 @@ fi %endif %changelog +* Thu Mar 21 2013 Sol Jerome <sol.jerome@gmail.com> 1.3.1-1 +- New upstream release + * Fri Mar 15 2013 Sol Jerome <sol.jerome@gmail.com> 1.3.0-0.0 - New upstream release diff --git a/osx/Makefile b/osx/Makefile index dbd771ed8..f25e71927 100644 --- a/osx/Makefile +++ b/osx/Makefile @@ -29,9 +29,9 @@ SITELIBDIR = /Library/Python/${PYVERSION}/site-packages # an Info.plist file for packagemaker to look at for package creation # and substitute the version strings. Major/Minor versions can only be # integers (e.g. "1" and "00" for bcfg2 version 1.0.0. -BCFGVER = 1.3.0 +BCFGVER = 1.3.1 MAJOR = 1 -MINOR = 30 +MINOR = 31 default: clean client diff --git a/osx/macports/Portfile b/osx/macports/Portfile index d3c162176..45cf3dd2b 100644 --- a/osx/macports/Portfile +++ b/osx/macports/Portfile @@ -5,7 +5,7 @@ PortSystem 1.0 PortGroup python26 1.0 name bcfg2 -version 1.3.0 +version 1.3.1 categories sysutils python maintainers gmail.com:sol.jerome license BSD diff --git a/redhat/VERSION b/redhat/VERSION index f0bb29e76..3a3cd8cc8 100644 --- a/redhat/VERSION +++ b/redhat/VERSION @@ -1 +1 @@ -1.3.0 +1.3.1 diff --git a/redhat/bcfg2.spec.in b/redhat/bcfg2.spec.in index fdc506d16..b1cd0d097 100644 --- a/redhat/bcfg2.spec.in +++ b/redhat/bcfg2.spec.in @@ -262,6 +262,9 @@ fi %doc %{_defaultdocdir}/bcfg2-doc-%{version} %changelog +* Thu Mar 21 2013 Sol Jerome <sol.jerome@gmail.com> 1.3.1-1 +- New upstream release + * Fri Mar 15 2013 Sol Jerome <sol.jerome@gmail.com> 1.3.0-0.0 - New upstream release @@ -23,7 +23,7 @@ if need_m2crypto: inst_reqs.append('M2Crypto') setup(name="Bcfg2", - version="1.3.0", + version="1.3.1", description="Bcfg2 Server", author="Narayan Desai", author_email="desai@mcs.anl.gov", diff --git a/solaris/Makefile b/solaris/Makefile index f9b376f50..fd2c254bb 100644 --- a/solaris/Makefile +++ b/solaris/Makefile @@ -1,7 +1,7 @@ #!/usr/sfw/bin/gmake PYTHON="/usr/local/bin/python" -VERS=1.3.0-1 +VERS=1.3.1-1 PYVERSION := $(shell $(PYTHON) -c "import sys; print sys.version[0:3]") default: clean package diff --git a/solaris/pkginfo.bcfg2 b/solaris/pkginfo.bcfg2 index 6126132ba..2bf3abaf5 100644 --- a/solaris/pkginfo.bcfg2 +++ b/solaris/pkginfo.bcfg2 @@ -1,7 +1,7 @@ PKG="SCbcfg2" NAME="bcfg2" ARCH="sparc" -VERSION="1.3.0" +VERSION="1.3.1" CATEGORY="application" VENDOR="Argonne National Labratory" EMAIL="bcfg-dev@mcs.anl.gov" diff --git a/solaris/pkginfo.bcfg2-server b/solaris/pkginfo.bcfg2-server index 9ab846732..4425220c2 100644 --- a/solaris/pkginfo.bcfg2-server +++ b/solaris/pkginfo.bcfg2-server @@ -1,7 +1,7 @@ PKG="SCbcfg2-server" NAME="bcfg2-server" ARCH="sparc" -VERSION="1.3.0" +VERSION="1.3.1" CATEGORY="application" VENDOR="Argonne National Labratory" EMAIL="bcfg-dev@mcs.anl.gov" diff --git a/src/lib/Bcfg2/Client/Tools/YUM.py b/src/lib/Bcfg2/Client/Tools/YUM.py index 7764a6808..c9fae7fc7 100644 --- a/src/lib/Bcfg2/Client/Tools/YUM.py +++ b/src/lib/Bcfg2/Client/Tools/YUM.py @@ -289,7 +289,7 @@ class YUM(Bcfg2.Client.Tools.PkgTool): def missing_attrs(self, entry): """ Implementing from superclass to check for existence of either - name or group attribute for Package entry in the case of a YUM + name or group attribute for Package entry in the case of a YUM group. """ missing = Bcfg2.Client.Tools.PkgTool.missing_attrs(self, entry) @@ -456,16 +456,16 @@ class YUM(Bcfg2.Client.Tools.PkgTool): group_type = entry.get('choose', 'default') if group_type in ['default', 'optional', 'all']: group_packages += [p - for p, d in + for p, d in group.default_packages.items() if d] if group_type in ['optional', 'all']: group_packages += [p - for p, d in + for p, d in group.optional_packages.items() if d] if len(group_packages) == 0: - self.logger.error("No packages found for group %s" % + self.logger.error("No packages found for group %s" % entry.get("group")) for pkg in group_packages: # create package instances for each package in yum group @@ -478,7 +478,7 @@ class YUM(Bcfg2.Client.Tools.PkgTool): instance.attrib['version'] = newest['version'] instance.attrib['epoch'] = newest['epoch'] instance.attrib['release'] = newest['release'] - except: + except: # pylint: disable=W0702 self.logger.info("Error finding newest package " "for %s" % pkg) @@ -511,7 +511,7 @@ class YUM(Bcfg2.Client.Tools.PkgTool): continue # Ignore duplicate instances else: pkg_cache.append(nevra) - + self.logger.debug("Verifying: %s" % nevra2string(nevra)) # Set some defaults here diff --git a/src/lib/Bcfg2/Logger.py b/src/lib/Bcfg2/Logger.py index c2eac1e60..89fa9fb79 100644 --- a/src/lib/Bcfg2/Logger.py +++ b/src/lib/Bcfg2/Logger.py @@ -105,7 +105,11 @@ class FragmentingSysLogHandler(logging.handlers.SysLogHandler): (self.encodePriority(self.facility, newrec.levelname.lower()), self.format(newrec)) try: - self.socket.send(msg.encode('ascii')) + try: + encoded = msg.encode('utf-8') + except UnicodeDecodeError: + encoded = msg + self.socket.send(encoded) except socket.error: for i in range(10): # pylint: disable=W0612 try: diff --git a/src/lib/Bcfg2/Reporting/templates/base.html b/src/lib/Bcfg2/Reporting/templates/base.html index 67ff1fc36..c73339911 100644 --- a/src/lib/Bcfg2/Reporting/templates/base.html +++ b/src/lib/Bcfg2/Reporting/templates/base.html @@ -88,7 +88,7 @@ <div style='clear:both'></div> </div><!-- document --> <div id="footer"> - <span>Bcfg2 Version 1.3.0</span> + <span>Bcfg2 Version 1.3.1</span> </div> <div id="calendar_div" style='position:absolute; visibility:hidden; background-color:white; layer-background-color:white;'></div> diff --git a/src/lib/Bcfg2/Server/Admin/Init.py b/src/lib/Bcfg2/Server/Admin/Init.py index 3e642ee49..4b8d65597 100644 --- a/src/lib/Bcfg2/Server/Admin/Init.py +++ b/src/lib/Bcfg2/Server/Admin/Init.py @@ -13,6 +13,7 @@ import subprocess import Bcfg2.Server.Admin import Bcfg2.Server.Plugin import Bcfg2.Options +import Bcfg2.Server.Plugins.Metadata from Bcfg2.Compat import input # pylint: disable=W0622 # default config file diff --git a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py index 178a47b1a..b44ff6970 100644 --- a/src/lib/Bcfg2/Server/FileMonitor/Inotify.py +++ b/src/lib/Bcfg2/Server/FileMonitor/Inotify.py @@ -2,6 +2,7 @@ support. """ import os +import errno import logging import pyinotify from Bcfg2.Compat import reduce # pylint: disable=W0622 @@ -182,6 +183,9 @@ class Inotify(Pseudo, pyinotify.ProcessEvent): try: watchdir = self.watches_by_path[watch_path] except KeyError: + if not os.path.exists(watch_path): + raise OSError(errno.ENOENT, + "No such file or directory: '%s'" % path) watchdir = self.watchmgr.add_watch(watch_path, self.mask, quiet=False)[watch_path] self.watches_by_path[watch_path] = watchdir diff --git a/src/lib/Bcfg2/version.py b/src/lib/Bcfg2/version.py index 9ecd7f32d..6f3ba3e49 100644 --- a/src/lib/Bcfg2/version.py +++ b/src/lib/Bcfg2/version.py @@ -2,7 +2,7 @@ import re -__version__ = "1.3.0" +__version__ = "1.3.1" class Bcfg2VersionInfo(tuple): diff --git a/src/sbin/bcfg2-reports b/src/sbin/bcfg2-reports index 9f2ff96c2..2c4a918be 100755 --- a/src/sbin/bcfg2-reports +++ b/src/sbin/bcfg2-reports @@ -10,7 +10,7 @@ from Bcfg2.Compat import ConfigParser try: import Bcfg2.settings except ConfigParser.NoSectionError: - print("Your bcfg2.conf is currently missing the statistics section which " + print("Your bcfg2.conf is currently missing the [database] section which " "is necessary for the reporting interface. Please see bcfg2.conf(5) " "for more details.") sys.exit(1) @@ -121,7 +121,7 @@ def main(): help="Show hosts that haven't run in the last 24 " "hours") parser.add_option_group(allhostmodes) - + # entry modes entrymodes = \ OptionGroup(parser, "Entry Modes", @@ -166,7 +166,7 @@ def main(): (mode.get_opt_string(), opt.get_opt_string())) mode = opt mode_family = parser.get_option_group(opt.get_opt_string()) - + # you can specify more than one of --bad, --extra, --modified, --show, so # consider single-host options separately if not mode_family: @@ -174,7 +174,7 @@ def main(): if getattr(options, opt.dest): mode_family = parser.get_option_group(opt.get_opt_string()) break - + if not mode_family: parser.error("You must specify a mode") @@ -243,7 +243,7 @@ def main(): parser.error("%s require either a list of entries on the " "command line or the --file options" % mode_family.title) - + if options.badentry: result = hosts_by_entry_type(clients, "bad", entries) elif options.modifiedentry: @@ -263,7 +263,7 @@ def main(): # todo batch fetch this. sqlite could break for client in clients: - ents = entry_cls.objects.filter(name=entries[0][1], + ents = entry_cls.objects.filter(name=entries[0][1], interaction=client.current_interaction) if len(ents) == 0: continue diff --git a/testsuite/Testsrc/test_code_checks.py b/testsuite/Testsrc/test_code_checks.py index ded9cd8e3..3036397b6 100644 --- a/testsuite/Testsrc/test_code_checks.py +++ b/testsuite/Testsrc/test_code_checks.py @@ -159,12 +159,14 @@ class TestPylint(Bcfg2TestCase): blacklist def get_env(self): - env = copy.copy(os.environ) - if 'PYTHONPATH' in os.environ: - env['PYTHONPATH'] = '%s:%s' % (env['PYTHONPATH'], testdir) + if ('PYTHONPATH' not in os.environ or + testdir not in os.environ['PYTHONPATH'].split(":")): + env = copy.copy(os.environ) + env['PYTHONPATH'] = ':'.join([env.get("PYTHONPATH", ""), + testdir]) + return env else: - env['PYTHONPATH'] = testdir - return env + return os.environ @skipIf(not os.path.exists(srcpath), "%s does not exist" % srcpath) @skipIf(not os.path.exists(rcfile), "%s does not exist" % rcfile) diff --git a/tools/upgrade/1.3/migrate_perms_to_mode.py b/tools/upgrade/1.3/migrate_perms_to_mode.py index a15de6e29..e061558d3 100755 --- a/tools/upgrade/1.3/migrate_perms_to_mode.py +++ b/tools/upgrade/1.3/migrate_perms_to_mode.py @@ -24,7 +24,12 @@ def writefile(f, xdata): def convertinfo(ifile): """Do perms -> mode conversion for info.xml files.""" - xdata = lxml.etree.parse(ifile) + try: + xdata = lxml.etree.parse(ifile) + except lxml.etree.XMLSyntaxError: + err = sys.exc_info()[1] + print("Could not parse %s, skipping: %s" % (ifile, err)) + return found = False for i in xdata.findall('//Info'): found = setmodeattr(i) @@ -34,9 +39,14 @@ def convertinfo(ifile): def convertstructure(structfile): """Do perms -> mode conversion for structure files.""" - xdata = lxml.etree.parse(structfile) + try: + xdata = lxml.etree.parse(structfile) + except lxml.etree.XMLSyntaxError: + err = sys.exc_info()[1] + print("Could not parse %s, skipping: %s" % (structfile, err)) + return found = False - for path in xdata.xpath('//BoundPath|Path'): + for path in xdata.xpath('//BoundPath|//Path'): found = setmodeattr(path) if found: writefile(structfile, xdata) @@ -55,7 +65,7 @@ def main(): for root, dirs, files in os.walk(os.path.join(repo, plugin)): for fname in files: convertstructure(os.path.join(root, fname)) - if plugin not in ['Cfg', 'TGenshi', 'TCheetah']: + if plugin not in ['Cfg', 'TGenshi', 'TCheetah', 'SSHbase', 'SSLCA']: continue for root, dirs, files in os.walk(os.path.join(repo, plugin)): for fname in files: |