The yumcmd.check_update method returns the str value of an yum package
object. In the latest version of yum, the str method looks like
out = '%s-%s-%s.%s' % (self.name, self.version, self.release, self.arch)
The result is something like "foo-1.0-2.noarch". However, the update
method only takes an rpm name. In the example, the name is simply "foo."
Running the command yumcmd.update("foo-1.0-2.noarch") won't do anything
because no package has that *name*. Only yumcmd.update("foo") will
update the package.
I've changed the update method to pass in a pattern instead of a name.
Yum is much more flexible when dealing with patterns and will actually
update if you leave in the version, release, and architecture.
---------------
Regards,
Alex
--
Software Engineer
Red Hat
919.754.4445
>From b4c047fc81929902b3e7c7d4870a4004ab697b1b Mon Sep 17 00:00:00 2001
From: Alex Wood <awood@xxxxxxxxxx>
Date: Mon, 28 Jul 2008 15:20:03 -0400
Subject: [PATCH] Modifying the update command to use a pattern rather than a name.
---
func/minion/modules/yumcmd.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/func/minion/modules/yumcmd.py b/func/minion/modules/yumcmd.py
index 0048fc6..ad92ee5 100644
--- a/func/minion/modules/yumcmd.py
+++ b/func/minion/modules/yumcmd.py
@@ -32,7 +32,7 @@ class Yum(func_module.FuncModule):
try:
ayum.doLock()
if pkg != None:
- tx_result = ayum.update(name=pkg)
+ tx_result = ayum.update(pattern=pkg)
else:
tx_result = ayum.update()
ayum.buildTransaction()
--
1.5.4.1
_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list