diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-08-09 11:29:29 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-08-09 11:52:20 -0400 |
commit | 17d634011069564435df21d6bc1cd415f6e9f3e0 (patch) | |
tree | 394dc203797d402af42b11f6b86d2ecff377974d /src/lib/Bcfg2 | |
parent | bd4bf2d48fda146f9b31c0253e11aba6cabb69d4 (diff) | |
download | bcfg2-17d634011069564435df21d6bc1cd415f6e9f3e0.tar.gz bcfg2-17d634011069564435df21d6bc1cd415f6e9f3e0.tar.bz2 bcfg2-17d634011069564435df21d6bc1cd415f6e9f3e0.zip |
use cPickle instead of pickle in Statistics
Diffstat (limited to 'src/lib/Bcfg2')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugin.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py index b66371a80..cc2fb96ba 100644 --- a/src/lib/Bcfg2/Server/Plugin.py +++ b/src/lib/Bcfg2/Server/Plugin.py @@ -4,7 +4,6 @@ import copy import logging import lxml.etree import os -import pickle import posixpath import re import sys @@ -22,9 +21,7 @@ except ImportError: # py3k compatibility if sys.hexversion >= 0x03000000: from functools import reduce -from Bcfg2.Bcfg2Py3k import Queue -from Bcfg2.Bcfg2Py3k import Empty -from Bcfg2.Bcfg2Py3k import Full +from Bcfg2.Bcfg2Py3k import Queue, Empty, Full, cPickle # grab default metadata info from bcfg2.conf opts = {'owner': Bcfg2.Options.MDATA_OWNER, @@ -263,7 +260,7 @@ class ThreadedStatistics(Statistics, threading.Thread): try: savefile = open(self.pending_file, 'w') - pickle.dump(pending_data, savefile) + cPickle.dump(pending_data, savefile) savefile.close() self.logger.info("Saved pending %s data" % self.name) except: @@ -276,7 +273,7 @@ class ThreadedStatistics(Statistics, threading.Thread): pending_data = [] try: savefile = open(self.pending_file, 'r') - pending_data = pickle.load(savefile) + pending_data = cPickle.load(savefile) savefile.close() except Exception: e = sys.exc_info()[1] |