diff options
author | Adrian Likins <alikins@redhat.com> | 2009-01-08 15:47:19 -0500 |
---|---|---|
committer | Adrian Likins <alikins@redhat.com> | 2009-01-08 15:47:19 -0500 |
commit | accd1d20b59b3e1c8d18d6ffabe78620a3cbd41e (patch) | |
tree | 557397bde4c6fa6a2a0eca4df6f595a77a02c6a7 | |
parent | c56427fb50221a027ee375d5ee440443d201cf1f (diff) | |
download | func-accd1d20b59b3e1c8d18d6ffabe78620a3cbd41e.tar.gz func-accd1d20b59b3e1c8d18d6ffabe78620a3cbd41e.tar.xz func-accd1d20b59b3e1c8d18d6ffabe78620a3cbd41e.zip |
move rpm/yum initiation to after module import to workaround rpm bug
See https://bugzilla.redhat.com/show_bug.cgi?id=476737
-rw-r--r-- | func/minion/modules/rpms.py | 3 | ||||
-rw-r--r-- | func/minion/modules/yumcmd.py | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/func/minion/modules/rpms.py b/func/minion/modules/rpms.py index f271406..746b9b8 100644 --- a/func/minion/modules/rpms.py +++ b/func/minion/modules/rpms.py @@ -9,7 +9,6 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import func_module -import rpm class RpmModule(func_module.FuncModule): @@ -27,6 +26,7 @@ class RpmModule(func_module.FuncModule): """ # I have not been able to get flatten=False to work if there # is more than 491 entries in the dict -- ashcrow + import rpm ts = rpm.TransactionSet() mi = ts.dbMatch() results = [] @@ -47,6 +47,7 @@ class RpmModule(func_module.FuncModule): """ Return a list of installed packages that match a pattern """ + import rpm ts = rpm.TransactionSet() mi = ts.dbMatch() results = [] diff --git a/func/minion/modules/yumcmd.py b/func/minion/modules/yumcmd.py index a35b104..6ab88b0 100644 --- a/func/minion/modules/yumcmd.py +++ b/func/minion/modules/yumcmd.py @@ -11,7 +11,6 @@ import func_module -import yum # XXX Use internal yum callback or write a useful one. class DummyCallback(object): @@ -26,6 +25,7 @@ class Yum(func_module.FuncModule): description = "Package updates through yum." def update(self, pkg=None): + import yum ayum = yum.YumBase() ayum.doGenericSetup() ayum.doRepoSetup() @@ -53,6 +53,7 @@ class Yum(func_module.FuncModule): if type(filter) not in [list, tuple]: filter = [filter] + import yum ayum = yum.YumBase() ayum.doConfigSetup() ayum.doTsSetup() |