summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml1
-rw-r--r--COPYRIGHT3
-rw-r--r--doc/development/plugins.txt2
-rw-r--r--doc/exts/xmlschema.py10
-rw-r--r--doc/server/encryption.txt3
-rw-r--r--doc/server/snapshots/index.txt5
-rw-r--r--misc/bcfg2.spec24
-rw-r--r--src/lib/Bcfg2/Client/Tools/Chkconfig.py1
-rw-r--r--src/lib/Bcfg2/Options.py2
-rw-r--r--src/lib/Bcfg2/Proxy.py2
-rw-r--r--src/lib/Bcfg2/Server/Plugin/helpers.py18
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py4
-rwxr-xr-xsrc/sbin/bcfg2-server6
-rwxr-xr-xtestsuite/install.sh2
-rwxr-xr-xtools/upgrade/1.3/migrate_info.py6
15 files changed, 62 insertions, 27 deletions
diff --git a/.travis.yml b/.travis.yml
index 655d9fad5..73b8a9594 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,7 +3,6 @@ python:
- "2.5"
- "2.6"
- "2.7"
- - "3.2"
env:
- WITH_OPTIONAL_DEPS=yes
- WITH_OPTIONAL_DEPS=no
diff --git a/COPYRIGHT b/COPYRIGHT
index 347d9b236..fa01cb568 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -156,3 +156,6 @@ add themselves to this file. See LICENSE for the full license.
- Zach Lowry <zach@mcs.anl.gov> wrote Solaris support and general
hardening.
+
+- Michael Fenn <fennm@deshawresearch.com> fixed various small bugs
+ related to bcfg2 on CentOS 5
diff --git a/doc/development/plugins.txt b/doc/development/plugins.txt
index 593c2f83e..3f2a888ac 100644
--- a/doc/development/plugins.txt
+++ b/doc/development/plugins.txt
@@ -213,4 +213,4 @@ See Also
--------
* :ref:`development-compat`
-* :ref:`development-utils
+* :ref:`development-utils`
diff --git a/doc/exts/xmlschema.py b/doc/exts/xmlschema.py
index 24cbf2e2d..c26aed81e 100644
--- a/doc/exts/xmlschema.py
+++ b/doc/exts/xmlschema.py
@@ -115,6 +115,7 @@ class _XMLDirective(Directive):
def run(self):
name = self.arguments[0]
env = self.state.document.settings.env
+ reporter = self.state.memo.reporter
ns_name = self.options.get('namespace')
try:
ns_uri = env.xmlschema_namespaces[ns_name]
@@ -129,8 +130,9 @@ class _XMLDirective(Directive):
except KeyError:
pass
else:
- env.app.error("No XML %s %s found" %
- (" or ".join(self.types), name))
+ reporter.error("No XML %s %s found" %
+ (" or ".join(self.types), name))
+ return []
documentor = XMLDocumentor(entity, env, self.state, name=name,
ns_uri=ns_uri,
include=self.process_include(),
@@ -172,6 +174,7 @@ class XMLDocumentor(object):
self.include = include
self.options = options
self.app = self.env.app
+ self.reporter = self.state.memo.reporter
if name is None:
self.ns_uri = ns_uri
@@ -312,7 +315,8 @@ class XMLDocumentor(object):
rv.extend(doc.document_complexType())
return rv
else:
- self.app.error("Unknown element type %s" % fqtype)
+ self.reporter.error("Unknown element type %s" % fqtype)
+ return []
else:
rv = []
typespec = self.entity.xpath("xs:complexType", namespaces=NSMAP)[0]
diff --git a/doc/server/encryption.txt b/doc/server/encryption.txt
index b56487620..e31124d4b 100644
--- a/doc/server/encryption.txt
+++ b/doc/server/encryption.txt
@@ -12,7 +12,8 @@ Bcfg2 supports encrypting some data on the disk, which can help
protect sensitive data from other people who need access to the Bcfg2
repository but are perhaps not authorized to see all data. It
supports multiple passphrases, which can be used to enforce
-separations between teams, environments, etc.
+separations between teams, environments, etc. Use of the encryption
+feature requires M2Crypto 0.18 or newer.
.. note::
diff --git a/doc/server/snapshots/index.txt b/doc/server/snapshots/index.txt
index 13a9fe2c0..a7e5940ed 100644
--- a/doc/server/snapshots/index.txt
+++ b/doc/server/snapshots/index.txt
@@ -8,9 +8,8 @@ Bcfg2 Snapshots
.. versionadded:: 1.0.0
-This page describes the Snapshots plugin. This plugin is meant to replace
-the older :ref:`reports-dynamic`. It stores various aspects of a client's
-state when the client checks into the server.
+This page describes the Snapshots plugin. Snapshots is deprecated, and
+will be removed in a future release.
Before you begin
================
diff --git a/misc/bcfg2.spec b/misc/bcfg2.spec
index b26119e06..f7289f1dd 100644
--- a/misc/bcfg2.spec
+++ b/misc/bcfg2.spec
@@ -100,11 +100,12 @@ Requires: python-ssl
%endif
Requires: python-lxml >= 1.2.1
%if "%{_vendor}" == "redhat"
-Requires: gamin-python
%endif
%if 0%{?suse_version}
+Requires: python-pyinotify
Requires: python-python-daemon
%else
+Requires: python-inotify
Requires: python-daemon
%endif
Requires: /usr/sbin/sendmail
@@ -190,6 +191,27 @@ Group: Documentation/HTML
%else
Group: Documentation
%endif
+%if 0%{?suse_version}
+BuildRequires: python-M2Crypto
+BuildRequires: python-Genshi
+BuildRequires: python-gamin
+BuildRequires: python-pyinotify
+BuildRequires: python-python-daemon
+BuildRequires: python-CherryPy >= 3
+%else
+BuildRequires: m2crypto
+BuildRequires: python-genshi
+BuildRequires: gamin-python
+BuildRequires: python-inotify
+BuildRequires: python-daemon
+%endif
+
+%if "%{_vendor}" == "redhat" && 0%{?rhel} < 6 && 0%{?fedora} == 0
+BuildRequires: python-ssl
+%else
+BuildRequires: python-cherrypy >= 3
+BuildRequires: python-mock
+%endif
%description doc
Bcfg2 helps system administrators produce a consistent, reproducible,
diff --git a/src/lib/Bcfg2/Client/Tools/Chkconfig.py b/src/lib/Bcfg2/Client/Tools/Chkconfig.py
index c3dcf7796..1fce5515b 100644
--- a/src/lib/Bcfg2/Client/Tools/Chkconfig.py
+++ b/src/lib/Bcfg2/Client/Tools/Chkconfig.py
@@ -21,6 +21,7 @@ class Chkconfig(Bcfg2.Client.Tools.SvcTool):
def VerifyService(self, entry, _):
"""Verify Service status for entry."""
+ entry.set('target_status', entry.get('status'))
if entry.get('status') == 'ignore':
return True
diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py
index fd7c4421a..243c4ed2a 100644
--- a/src/lib/Bcfg2/Options.py
+++ b/src/lib/Bcfg2/Options.py
@@ -579,7 +579,7 @@ SERVER_PASSWORD = \
SERVER_PROTOCOL = \
Option('Server Protocol',
default='xmlrpc/ssl',
- cf=('communication', 'procotol'))
+ cf=('communication', 'protocol'))
SERVER_BACKEND = \
Option('Server Backend',
default='best',
diff --git a/src/lib/Bcfg2/Proxy.py b/src/lib/Bcfg2/Proxy.py
index 9246c0f87..f6db66a93 100644
--- a/src/lib/Bcfg2/Proxy.py
+++ b/src/lib/Bcfg2/Proxy.py
@@ -314,7 +314,7 @@ class XMLRPCTransport(xmlrpclib.Transport):
errcode = response.status
errmsg = response.reason
headers = response.msg
- except (socket.error, SSL_ERROR):
+ except (socket.error, SSL_ERROR, httplib.BadStatusLine):
err = sys.exc_info()[1]
raise ProxyError(xmlrpclib.ProtocolError(host + handler,
408,
diff --git a/src/lib/Bcfg2/Server/Plugin/helpers.py b/src/lib/Bcfg2/Server/Plugin/helpers.py
index b14968d77..81dc1d736 100644
--- a/src/lib/Bcfg2/Server/Plugin/helpers.py
+++ b/src/lib/Bcfg2/Server/Plugin/helpers.py
@@ -41,15 +41,15 @@ del DEFAULT_FILE_METADATA['configfile']
LOGGER = logging.getLogger(__name__)
#: a compiled regular expression for parsing info and :info files
-INFO_REGEX = re.compile(r'owner:(\s)*(?P<owner>\S+)|' +
- r'group:(\s)*(?P<group>\S+)|' +
- r'mode:(\s)*(?P<mode>\w+)|' +
- r'secontext:(\s)*(?P<secontext>\S+)|' +
- r'paranoid:(\s)*(?P<paranoid>\S+)|' +
- r'sensitive:(\s)*(?P<sensitive>\S+)|' +
- r'encoding:(\s)*(?P<encoding>\S+)|' +
- r'important:(\s)*(?P<important>\S+)|' +
- r'mtime:(\s)*(?P<mtime>\w+)|')
+INFO_REGEX = re.compile(r'owner:\s*(?P<owner>\S+)|' +
+ r'group:\s*(?P<group>\S+)|' +
+ r'mode:\s*(?P<mode>\w+)|' +
+ r'secontext:\s*(?P<secontext>\S+)|' +
+ r'paranoid:\s*(?P<paranoid>\S+)|' +
+ r'sensitive:\s*(?P<sensitive>\S+)|' +
+ r'encoding:\s*(?P<encoding>\S+)|' +
+ r'important:\s*(?P<important>\S+)|' +
+ r'mtime:\s*(?P<mtime>\w+)')
def bind_info(entry, metadata, infoxml=None, default=DEFAULT_FILE_METADATA):
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
index ffe93c25b..c6ac9d8dc 100644
--- a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
+++ b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
@@ -520,7 +520,9 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet,
return
elif hdlr.ignore(event, basename=self.path):
return
- elif action == 'changed':
+ # we only get here if event.filename in self.entries, so handle
+ # created event like changed
+ elif action == 'changed' or action == 'created':
self.entries[event.filename].handle_event(event)
return
elif action == 'deleted':
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index 21f7842ec..4c4a71fa7 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -37,8 +37,8 @@ def main():
coremodule = backends[setup['backend']]
try:
- Core = getattr(__import__("Bcfg2.Server.%s" % coremodule).Server,
- coremodule).Core
+ corecls = getattr(__import__("Bcfg2.Server.%s" % coremodule).Server,
+ coremodule).Core
except ImportError:
err = sys.exc_info()[1]
print("Unable to import %s server core: %s" % (setup['backend'], err))
@@ -49,7 +49,7 @@ def main():
raise
try:
- core = Core(setup)
+ core = corecls(setup)
core.run()
except CoreInitError:
msg = sys.exc_info()[1]
diff --git a/testsuite/install.sh b/testsuite/install.sh
index 817ed5911..1ca89f40f 100755
--- a/testsuite/install.sh
+++ b/testsuite/install.sh
@@ -15,7 +15,7 @@ if [[ "$WITH_OPTIONAL_DEPS" == "yes" ]]; then
if [[ ${PYVER:0:1} == "2" ]]; then
# django supports py3k, but South doesn't, and the django bits
# in bcfg2 require South
- pip install cheetah 'django<1.5' South M2Crypto
+ pip install cheetah 'django<1.5' 'South<0.8' M2Crypto
fi
else
# python < 2.6 requires M2Crypto for SSL communication, not just
diff --git a/tools/upgrade/1.3/migrate_info.py b/tools/upgrade/1.3/migrate_info.py
index e72599daf..3ccbf0285 100755
--- a/tools/upgrade/1.3/migrate_info.py
+++ b/tools/upgrade/1.3/migrate_info.py
@@ -1,12 +1,16 @@
#!/usr/bin/env python
import os
+import re
import sys
import lxml.etree
import Bcfg2.Options
from Bcfg2.Server.Plugin import INFO_REGEX
+PERMS_REGEX = re.compile(r'perms:\s*(?P<perms>\w+)')
+
+
def convert(info_file):
info_xml = os.path.join(os.path.dirname(info_file), "info.xml")
if os.path.exists(info_xml):
@@ -16,7 +20,7 @@ def convert(info_file):
fileinfo = lxml.etree.Element("FileInfo")
info = lxml.etree.SubElement(fileinfo, "Info")
for line in open(info_file).readlines():
- match = INFO_REGEX.match(line)
+ match = INFO_REGEX.match(line) or PERMS_REGEX.match(line)
if match:
mgd = match.groupdict()
for key, value in list(mgd.items()):