summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-20 11:10:43 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2013-05-20 11:10:43 -0400
commit10d60b35ce384d4b73fd63939aa65b07e9032a12 (patch)
treedbda095dca372c38d15a32a490adc2f2b16f0d83 /src
parent5945f7f16a40066f748808c35d1db4dd0de291b6 (diff)
downloadbcfg2-10d60b35ce384d4b73fd63939aa65b07e9032a12.tar.gz
bcfg2-10d60b35ce384d4b73fd63939aa65b07e9032a12.tar.bz2
bcfg2-10d60b35ce384d4b73fd63939aa65b07e9032a12.zip
fixed unit tests
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Client/Client.py2
-rw-r--r--src/lib/Bcfg2/Server/Core.py7
-rw-r--r--src/lib/Bcfg2/Server/Plugin/helpers.py4
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Bundler.py2
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Packages/__init__.py2
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Properties.py1
6 files changed, 8 insertions, 10 deletions
diff --git a/src/lib/Bcfg2/Client/Client.py b/src/lib/Bcfg2/Client/Client.py
index 10a15f160..994ce7c84 100644
--- a/src/lib/Bcfg2/Client/Client.py
+++ b/src/lib/Bcfg2/Client/Client.py
@@ -174,7 +174,7 @@ class Client(object):
Bcfg2.Client.XML.tostring(
probedata,
xml_declaration=False).decode('utf-8'))
- except Bcfg2.Proxy.ProxyError:
+ except Bcfg2.Client.Proxy.ProxyError:
err = sys.exc_info()[1]
self.fatal_error("Failed to upload probe data: %s" % err)
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index e356a0b4d..d61543256 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -140,7 +140,7 @@ class BaseCore(object):
# enable debugging on the core now. debugging is enabled on
# everything else later
if self.setup['debug']:
- self.set_core_debug(None, setup['debug'])
+ self.set_core_debug(None, self.setup['debug'])
if 'ignore' not in self.setup:
self.setup.add_option('ignore', SERVER_FAM_IGNORE)
@@ -149,10 +149,7 @@ class BaseCore(object):
famargs = dict(filemonitor=self.setup['filemonitor'],
debug=self.setup['debug'],
ignore=self.setup['ignore'])
- try:
- filemonitor = \
- Bcfg2.Server.FileMonitor.available[setup['filemonitor']]
- except KeyError:
+ if self.setup['filemonitor'] not in Bcfg2.Server.FileMonitor.available:
self.logger.error("File monitor driver %s not available; "
"forcing to default" % self.setup['filemonitor'])
famargs['filemonitor'] = 'default'
diff --git a/src/lib/Bcfg2/Server/Plugin/helpers.py b/src/lib/Bcfg2/Server/Plugin/helpers.py
index f0ab56935..48e748c47 100644
--- a/src/lib/Bcfg2/Server/Plugin/helpers.py
+++ b/src/lib/Bcfg2/Server/Plugin/helpers.py
@@ -3,6 +3,7 @@
import os
import re
import sys
+import time
import copy
import glob
import genshi
@@ -59,7 +60,8 @@ class track_statistics(object): # pylint: disable=C0103
try:
return func(obj, *args, **kwargs)
finally:
- Bcfg2.Statistics.stats.add_value(name, time.time() - start)
+ Bcfg2.Server.Statistics.stats.add_value(name,
+ time.time() - start)
return inner
diff --git a/src/lib/Bcfg2/Server/Plugins/Bundler.py b/src/lib/Bcfg2/Server/Plugins/Bundler.py
index d114b0873..2473a3ed2 100644
--- a/src/lib/Bcfg2/Server/Plugins/Bundler.py
+++ b/src/lib/Bcfg2/Server/Plugins/Bundler.py
@@ -12,7 +12,7 @@ from genshi.template import TemplateError
class BundleFile(Bcfg2.Server.Plugin.StructFile):
""" Representation of a bundle XML file """
- bundle_name_re = re.compile('^(?P<name>.*)\.(xml|genshi)$')
+ bundle_name_re = re.compile(r'^(?P<name>.*)\.(xml|genshi)$')
def __init__(self, filename, should_monitor=False):
Bcfg2.Server.Plugin.StructFile.__init__(self, filename,
diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
index 07e580bc3..567a16c40 100644
--- a/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
+++ b/src/lib/Bcfg2/Server/Plugins/Packages/__init__.py
@@ -320,7 +320,7 @@ class Packages(Bcfg2.Server.Plugin.Plugin,
for struct in structures:
for pkg in struct.xpath('//Package | //BoundPackage'):
if pkg.get("name"):
- base.update(collection.packages_from_entry(pkg))
+ initial.update(collection.packages_from_entry(pkg))
elif pkg.get("group"):
groups.append((pkg.get("group"),
pkg.get("type")))
diff --git a/src/lib/Bcfg2/Server/Plugins/Properties.py b/src/lib/Bcfg2/Server/Plugins/Properties.py
index f091acf01..8e54da19b 100644
--- a/src/lib/Bcfg2/Server/Plugins/Properties.py
+++ b/src/lib/Bcfg2/Server/Plugins/Properties.py
@@ -240,7 +240,6 @@ class Properties(Bcfg2.Server.Plugin.Plugin,
ignore = re.compile(r'.*\.xsd$')
def __init__(self, core, datastore):
- global SETUP # pylint: disable=W0603
Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
Bcfg2.Server.Plugin.Connector.__init__(self)
Bcfg2.Server.Plugin.DirectoryBacked.__init__(self, self.data)