12876: Call attention to missing python and ruby dependencies.
authorTom Clegg <tclegg@veritasgenetics.com>
Mon, 8 Jan 2018 01:40:32 +0000 (20:40 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Mon, 8 Jan 2018 01:40:32 +0000 (20:40 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

lib/cli/external.go

index ba85aae9eaff654759c9eae1b3951264000d5cf2..35933f99fc2afafdb970cc2127587f182364f094 100644 (file)
@@ -92,8 +92,33 @@ func (ec externalCmd) RunCommand(prog string, args []string, stdin io.Reader, st
                }
                fmt.Fprintf(stderr, "%s failed: %s\n", ec.prog, err)
                return 1
+       case *exec.Error:
+               fmt.Fprintln(stderr, err)
+               if ec.prog == "arv" || ec.prog == "arv-run-pipeline-instance" {
+                       fmt.Fprint(stderr, rubyInstallHints)
+               } else if strings.HasPrefix(ec.prog, "arv-") {
+                       fmt.Fprint(stderr, pythonInstallHints)
+               }
+               return 1
        default:
                fmt.Fprintf(stderr, "error running %s: %s\n", ec.prog, err)
                return 1
        }
 }
+
+var (
+       rubyInstallHints = `
+Note: This subcommand uses the arvados-cli Ruby gem. If that is not
+installed, try "gem install arvados-cli", or see
+https://doc.arvados.org/install for more details.
+
+`
+       pythonInstallHints = `
+Note: This subcommand uses the "arvados" Python module. If that is
+not installed, try:
+* "pip install arvados" (either as root or in a virtualenv), or
+* "sudo apt-get install python-arvados-python-client", or
+* see https://doc.arvados.org/install for more details.
+
+`
+)