Blob Blame History Raw
commit 460f50548587f692499daae9e38e5c17c85fa078 (HEAD, origin/master, origin/HEAD, master)
Author: Bill Nottingham <notting@redhat.com>
Date:   Mon Aug 13 15:47:31 2012 -0400

    Fix plugin type to work correctly with registerCommand, and avoid similar failures in the future. (#847502)

diff --git a/langpacks.py b/langpacks.py
index 09f1136..d1b0b33 100644
--- a/langpacks.py
+++ b/langpacks.py
@@ -17,7 +17,7 @@
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 
-from yum.plugins import TYPE_CORE
+from yum.plugins import TYPE_INTERACTIVE
 
 from yum.constants import *
 
@@ -38,7 +38,7 @@ def iterparse(filename):
         print >>sys.stderr, '%s: %s' % (filename, str(e))
 
 requires_api_version = '2.5'
-plugin_type = TYPE_CORE
+plugin_type = TYPE_INTERACTIVE
 
 langs = []
 langinstalled = []
@@ -130,9 +130,10 @@ def config_hook(conduit):
     if hasattr(parser, 'plugin_option_group'):
         parser = parser.plugin_option_group
 
-    conduit.registerCommand(LanginstallCommand())
-    conduit.registerCommand(LangremoveCommand())
-    conduit.registerCommand(LanglistCommand())
+    if hasattr(conduit, 'registerCommand'):
+        conduit.registerCommand(LanginstallCommand())
+        conduit.registerCommand(LangremoveCommand())
+        conduit.registerCommand(LanglistCommand())
 
 def init_hook(conduit):
     global langs