[PATCH 2/2] Catch the case where the runroot plugin is not installed.

Ralph Bean rbean at redhat.com
Sat Jun 6 19:36:03 UTC 2015


---
 cli/koji | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/cli/koji b/cli/koji
index 6cdecaa..908d829 100755
--- a/cli/koji
+++ b/cli/koji
@@ -6473,12 +6473,18 @@ def handle_runroot(options, session, args):
         command = ' '.join(args[2:])
     else:
         command = args[2:]
-    task_id = session.runroot(tag, arch, command,
-                              channel=opts.channel_override,
-                              packages=opts.package, mounts=opts.mount,
-                              repo_id=opts.repo_id,
-                              skip_setarch=opts.skip_setarch,
-                              weight=opts.weight)
+    try:
+        task_id = session.runroot(tag, arch, command,
+                                channel=opts.channel_override,
+                                packages=opts.package, mounts=opts.mount,
+                                repo_id=opts.repo_id,
+                                skip_setarch=opts.skip_setarch,
+                                weight=opts.weight)
+    except koji.GenericError as e:
+        if 'Invalid method' in str(e):
+            print "* The runroot plugin appears to not be installed on the",
+            print "koji hub.  Please contact the administrator."
+        raise
     if opts.task_id:
         print task_id
 
-- 
2.4.2



More information about the buildsys mailing list