From 48dea2ea0ce93b80484abac6875da4fdf5a20ce7 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Thu, 8 Aug 2013 15:35:23 -0400 Subject: testsuite: fixed unit tests for server plugins --- .../Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py | 2 +- src/lib/Bcfg2/Server/Plugins/Probes.py | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/lib/Bcfg2/Server') diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py index 50de498e6..c08d3ec44 100644 --- a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py +++ b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgAuthorizedKeysGenerator.py @@ -22,7 +22,7 @@ class CfgAuthorizedKeysGenerator(CfgGenerator, StructFile): __basenames__ = ['authorizedkeys.xml', 'authorized_keys.xml'] def __init__(self, fname): - CfgGenerator.__init__(self, fname, None, None) + CfgGenerator.__init__(self, fname, None) StructFile.__init__(self, fname) self.cache = dict() self.core = CFG.core diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py index 0d264a5a6..ad9e5a88d 100644 --- a/src/lib/Bcfg2/Server/Plugins/Probes.py +++ b/src/lib/Bcfg2/Server/Plugins/Probes.py @@ -14,11 +14,11 @@ from Bcfg2.Server.Statistics import track_statistics HAS_DJANGO = False ProbesDataModel = None -ProbesGroupModel = None +ProbesGroupsModel = None def load_django_models(): - global ProbesDataModel, ProbesGroupModel, HAS_DJANGO + global ProbesDataModel, ProbesGroupsModel, HAS_DJANGO try: from django.db import models HAS_DJANGO = True @@ -128,11 +128,6 @@ class ProbeSet(Bcfg2.Server.Plugin.EntrySet): bangline = re.compile(r'^#!\s*(?P.*)$') basename_is_regex = True - options = [ - Bcfg2.Options.BooleanOption( - cf=('probes', 'use_database'), dest="probes_db", - help="Use database capabilities of the Probes plugin")] - def __init__(self, path, plugin_name): self.plugin_name = plugin_name Bcfg2.Server.Plugin.EntrySet.__init__(self, r'[0-9A-Za-z_\-]+', path, @@ -201,6 +196,12 @@ class Probes(Bcfg2.Server.Plugin.Probing, """ A plugin to gather information from a client machine """ __author__ = 'bcfg-dev@mcs.anl.gov' + options = [ + Bcfg2.Options.BooleanOption( + cf=('probes', 'use_database'), dest="probes_db", + help="Use database capabilities of the Probes plugin")] + options_parsed_hook = load_django_models + def __init__(self, core, datastore): Bcfg2.Server.Plugin.Probing.__init__(self) Bcfg2.Server.Plugin.Caching.__init__(self) -- cgit v1.2.3-1-g7c22