From fc296f452029120c79c25444195f346855ed6dde Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Fri, 3 Aug 2012 15:18:20 -0400 Subject: get encoding a better way in packages collection objects --- src/lib/Bcfg2/Server/Plugin.py | 5 ----- src/lib/Bcfg2/Server/Plugins/Packages/Collection.py | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py index 0b620c2d2..7fe98ea92 100644 --- a/src/lib/Bcfg2/Server/Plugin.py +++ b/src/lib/Bcfg2/Server/Plugin.py @@ -29,11 +29,6 @@ from Bcfg2.Bcfg2Py3k import Queue from Bcfg2.Bcfg2Py3k import Empty from Bcfg2.Bcfg2Py3k import Full -# make encoding available -encparse = Bcfg2.Options.OptionParser({'encoding': Bcfg2.Options.ENCODING}) -encparse.parse([]) -encoding = encparse['encoding'] - # grab default metadata info from bcfg2.conf opts = {'owner': Bcfg2.Options.MDATA_OWNER, 'group': Bcfg2.Options.MDATA_GROUP, diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Collection.py b/src/lib/Bcfg2/Server/Plugins/Packages/Collection.py index da88a1315..a42561f2e 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Collection.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Collection.py @@ -52,7 +52,7 @@ class Collection(Bcfg2.Server.Plugin.Debuggable): @property def cachekey(self): - return md5(self.sourcelist().encode(Bcfg2.Server.Plugin.encoding)).hexdigest() + return md5(self.sourcelist().encode(self.setup['encoding'])).hexdigest() def get_config(self): self.logger.error("Packages: Cannot generate config for host %s with " -- cgit v1.2.3-1-g7c22