summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-24 14:51:36 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-09-25 11:58:48 -0400
commit3f16355e18cdceb37828a00a8181d9cc60815cd0 (patch)
treee2b38114e0a06d3c7b28ad4ef5c15793e21eb2b3 /src
parent47aebb16f15fe6f8ce29d8c6b105f10d8d64c295 (diff)
downloadbcfg2-3f16355e18cdceb37828a00a8181d9cc60815cd0.tar.gz
bcfg2-3f16355e18cdceb37828a00a8181d9cc60815cd0.tar.bz2
bcfg2-3f16355e18cdceb37828a00a8181d9cc60815cd0.zip
fixed tests for pylint changes
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/base.py2
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Metadata.py26
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Probes.py7
3 files changed, 19 insertions, 16 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/base.py b/src/lib/Bcfg2/Client/Tools/POSIX/base.py
index 6e7eb70b0..94a490fda 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/base.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/base.py
@@ -516,6 +516,8 @@ class POSIXTool(Bcfg2.Client.Tools.Tool):
if val is not None:
entry.set(attr, str(val))
+ print "about to verify acls; errors=%s" % errors
+
return self._verify_acls(entry, path=path) and len(errors) == 0
def _list_entry_acls(self, entry):
diff --git a/src/lib/Bcfg2/Server/Plugins/Metadata.py b/src/lib/Bcfg2/Server/Plugins/Metadata.py
index e0904339f..468d1f190 100644
--- a/src/lib/Bcfg2/Server/Plugins/Metadata.py
+++ b/src/lib/Bcfg2/Server/Plugins/Metadata.py
@@ -1,6 +1,5 @@
-"""
-This file stores persistent metadata for the Bcfg2 Configuration Repository.
-"""
+""" This file stores persistent metadata for the Bcfg2 Configuration
+Repository. """
import re
import os
@@ -15,7 +14,7 @@ import Bcfg2.Server
import Bcfg2.Server.Lint
import Bcfg2.Server.Plugin
import Bcfg2.Server.FileMonitor
-from Bcfg2.Compat import MutableMapping, all
+from Bcfg2.Compat import MutableMapping, all # pylint: disable=W0622
from Bcfg2.version import Bcfg2VersionInfo
try:
@@ -26,6 +25,7 @@ except ImportError:
logger = logging.getLogger(__name__)
+
def locked(fd):
"""Aquire a lock on a file"""
try:
@@ -104,13 +104,17 @@ class XMLMetadataConfig(Bcfg2.Server.Plugin.XMLFileBacked):
self.pseudo_monitor = isinstance(metadata.core.fam,
Bcfg2.Server.FileMonitor.Pseudo)
- @property
- def xdata(self): # pylint: disable=E0202
+ def _get_xdata(self):
if not self.data:
raise Bcfg2.Server.Plugin.MetadataRuntimeError("%s has no data" %
self.basefile)
return self.data
+ def _set_xdata(self, val):
+ self.data = val
+
+ xdata = property(_get_xdata, _set_xdata)
+
@property
def base_xdata(self):
if not self.basedata:
@@ -738,11 +742,7 @@ class Metadata(Bcfg2.Server.Plugin.Metadata,
# clear the entire cache when we get an event for any
# metadata file
self.core.metadata_cache.expire()
- try:
- proc = getattr(self, "_handle_%s_event" % aname)
- except AttributeError:
- proc = self._handle_default_event # pylint: disable=E1101
- proc(event)
+ getattr(self, "_handle_%s_event" % aname)(event)
if False not in list(self.states.values()) and self.debug_flag:
# check that all groups are real and complete. this is
@@ -853,8 +853,8 @@ class Metadata(Bcfg2.Server.Plugin.Metadata,
address = addresspair[0]
if address in self.addresses:
if len(self.addresses[address]) != 1:
- err = "Address %s has multiple reverse assignments; a " + \
- "uuid must be used" % address
+ err = ("Address %s has multiple reverse assignments; a "
+ "uuid must be used" % address)
self.logger.error(err)
raise Bcfg2.Server.Plugin.MetadataConsistencyError(err)
return self.addresses[address][0]
diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py
index 58723e392..49e3b5e63 100644
--- a/src/lib/Bcfg2/Server/Plugins/Probes.py
+++ b/src/lib/Bcfg2/Server/Plugins/Probes.py
@@ -13,6 +13,7 @@ import Bcfg2.Server.Plugin
# pylint: disable=F0401
try:
from django.db import models
+ HAS_DJANGO = True
class ProbesDataModel(models.Model,
Bcfg2.Server.Plugin.PluginDatabaseModel):
@@ -28,7 +29,7 @@ try:
hostname = models.CharField(max_length=255)
group = models.CharField(max_length=255)
except ImportError:
- pass
+ HAS_DJANGO = False
try:
import json
@@ -72,8 +73,8 @@ class ProbeData(str):
def __new__(cls, data):
return str.__new__(cls, data)
- def __init__(self):
- str.__init__(self)
+ def __init__(self, data):
+ str.__init__(self, data)
self._xdata = None
self._json = None
self._yaml = None