diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Logger.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Lint/MergeFiles.py | 6 | ||||
-rw-r--r-- | src/lib/Server/Plugin.py | 7 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Base.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Bundler.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Metadata.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Properties.py | 2 | ||||
-rw-r--r-- | src/lib/Server/Plugins/Statistics.py | 2 |
8 files changed, 12 insertions, 13 deletions
diff --git a/src/lib/Logger.py b/src/lib/Logger.py index 0acafb24c..e8f9ecd47 100644 --- a/src/lib/Logger.py +++ b/src/lib/Logger.py @@ -88,7 +88,7 @@ class FragmentingSysLogHandler(logging.handlers.SysLogHandler): record.exc_info = None msgdata = record.msg while msgdata: - newrec = copy.deepcopy(record) + newrec = copy.copy(record) newrec.msg = msgdata[:250] msgs.append(newrec) msgdata = msgdata[250:] diff --git a/src/lib/Server/Lint/MergeFiles.py b/src/lib/Server/Lint/MergeFiles.py index 52fea3d9b..ff6e3449a 100644 --- a/src/lib/Server/Lint/MergeFiles.py +++ b/src/lib/Server/Lint/MergeFiles.py @@ -1,5 +1,5 @@ import os -from copy import deepcopy +import copy from difflib import SequenceMatcher import Bcfg2.Server.Lint @@ -43,7 +43,7 @@ class MergeFiles(Bcfg2.Server.Lint.ServerPlugin): rv = [] elist = entries.items() while elist: - result = self._find_similar(elist.pop(0), deepcopy(elist), + result = self._find_similar(elist.pop(0), copy.copy(elist), threshold) if len(result) > 1: elist = [(fname, fdata) @@ -62,7 +62,7 @@ class MergeFiles(Bcfg2.Server.Lint.ServerPlugin): if (sm.real_quick_ratio() > threshold and sm.quick_ratio() > threshold and sm.ratio() > threshold): - rv.extend(self._find_similar((cname, cdata), deepcopy(others), + rv.extend(self._find_similar((cname, cdata), copy.copy(others), threshold)) return rv diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 4bfa3fdf5..86f843aca 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -283,7 +283,7 @@ class ThreadedStatistics(Statistics, def process_statistics(self, metadata, data): warned = False try: - self.work_queue.put_nowait((metadata, copy.deepcopy(data))) + self.work_queue.put_nowait((metadata, copy.copy(data))) warned = False except Full: if not warned: @@ -646,7 +646,7 @@ class StructFile(XMLFileBacked): rv.extend(self._match(child, metadata)) return rv else: - rv = copy.deepcopy(item) + rv = copy.copy(item) for child in rv.iterchildren(): rv.remove(child) for child in item.iterchildren(): @@ -859,7 +859,7 @@ class PrioDir(Plugin, Generator, XMLDirectoryBacked): if '__text__' in data: entry.text = data['__text__'] if '__children__' in data: - [entry.append(copy.deepcopy(item)) for item in data['__children__']] + [entry.append(copy.copy(item)) for item in data['__children__']] return dict([(key, data[key]) for key in list(data.keys()) @@ -867,7 +867,6 @@ class PrioDir(Plugin, Generator, XMLDirectoryBacked): # new unified EntrySet backend - class SpecificityError(Exception): """Thrown in case of filename parse failure.""" pass diff --git a/src/lib/Server/Plugins/Base.py b/src/lib/Server/Plugins/Base.py index 5de57a87c..e8d798ae4 100644 --- a/src/lib/Server/Plugins/Base.py +++ b/src/lib/Server/Plugins/Base.py @@ -41,5 +41,5 @@ class Base(Bcfg2.Server.Plugin.Plugin, fragments = reduce(lambda x, y: x + y, [base.Match(metadata) for base in list(self.entries.values())], []) - [ret.append(copy.deepcopy(frag)) for frag in fragments] + [ret.append(copy.copy(frag)) for frag in fragments] return [ret] diff --git a/src/lib/Server/Plugins/Bundler.py b/src/lib/Server/Plugins/Bundler.py index 4b73a17d4..04aa3df71 100644 --- a/src/lib/Server/Plugins/Bundler.py +++ b/src/lib/Server/Plugins/Bundler.py @@ -24,7 +24,7 @@ class BundleFile(Bcfg2.Server.Plugin.StructFile): def get_xml_value(self, metadata): bundlename = os.path.splitext(os.path.basename(self.name))[0] bundle = lxml.etree.Element('Bundle', name=bundlename) - [bundle.append(copy.deepcopy(item)) for item in self.Match(metadata)] + [bundle.append(copy.copy(item)) for item in self.Match(metadata)] return bundle diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py index 8afcd9c50..f837b1305 100644 --- a/src/lib/Server/Plugins/Metadata.py +++ b/src/lib/Server/Plugins/Metadata.py @@ -78,7 +78,7 @@ class XMLMetadataConfig(object): except lxml.etree.XMLSyntaxError: self.logger.error('Failed to parse %s' % (self.basefile)) return - self.basedata = copy.deepcopy(xdata) + self.basedata = copy.copy(xdata) included = [ent.get('href') for ent in \ xdata.findall('./{http://www.w3.org/2001/XInclude}include')] if included: diff --git a/src/lib/Server/Plugins/Properties.py b/src/lib/Server/Plugins/Properties.py index 9b44942cd..76945b3a0 100644 --- a/src/lib/Server/Plugins/Properties.py +++ b/src/lib/Server/Plugins/Properties.py @@ -74,4 +74,4 @@ class Properties(Bcfg2.Server.Plugin.Plugin, raise Bcfg2.Server.Plugin.PluginInitError def get_additional_data(self, _): - return copy.deepcopy(self.store.entries) + return copy.copy(self.store.entries) diff --git a/src/lib/Server/Plugins/Statistics.py b/src/lib/Server/Plugins/Statistics.py index 7251ab1b5..9dbbeec28 100644 --- a/src/lib/Server/Plugins/Statistics.py +++ b/src/lib/Server/Plugins/Statistics.py @@ -98,7 +98,7 @@ class StatisticsStore(object): newstat.set('time', asctime(localtime())) # Add statistic - node.append(copy.deepcopy(newstat)) + node.append(copy.copy(newstat)) # Set dirty self.dirty = 1 |