You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by ji...@apache.org on 2018/07/03 18:09:48 UTC

madlib git commit: Madpack: fix install/reinstall not giving proper error message

Repository: madlib
Updated Branches:
  refs/heads/master 610ea0b64 -> fd9efee01


Madpack: fix install/reinstall not giving proper error message

JIRA: MADLIB-1248

Previously, uninstalling or reinstalling on a database that does not have MADlib already
installed fails as expected. However, the info messages do not mention
this failure and also keeps going to prepare database objects to
install. This commit fixes this issue. If there is no madlib installed
in database, madpack will show nothing found to uninstall/reinstall and
stop.

Closes #285


Project: http://git-wip-us.apache.org/repos/asf/madlib/repo
Commit: http://git-wip-us.apache.org/repos/asf/madlib/commit/fd9efee0
Tree: http://git-wip-us.apache.org/repos/asf/madlib/tree/fd9efee0
Diff: http://git-wip-us.apache.org/repos/asf/madlib/diff/fd9efee0

Branch: refs/heads/master
Commit: fd9efee01558f0146cc366f51981487f52cf1783
Parents: 610ea0b
Author: Jingyi Mei <jm...@pivotal.io>
Authored: Sun Jul 1 17:49:24 2018 -0700
Committer: Jingyi Mei <jm...@pivotal.io>
Committed: Tue Jul 3 11:08:09 2018 -0700

----------------------------------------------------------------------
 src/madpack/madpack.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/madlib/blob/fd9efee0/src/madpack/madpack.py
----------------------------------------------------------------------
diff --git a/src/madpack/madpack.py b/src/madpack/madpack.py
index 9a03018..f21f2c0 100755
--- a/src/madpack/madpack.py
+++ b/src/madpack/madpack.py
@@ -972,7 +972,8 @@ def run_install_check(args, testcase, madpack_cmd):
 def _append_uninstall_madlib_sqlfile(schema, db_madlib_ver, is_schema_in_db,
                                      output_filehandle):
     if get_rev_num(db_madlib_ver) == [0]:
-        info_(this, "Nothing to uninstall. No version found in schema %s." % schema, True)
+        info_(this, "Nothing to uninstall or reinstall. No version found in schema %s."
+            % schema, True)
         return 1, is_schema_in_db
 
     # Find any potential data to lose
@@ -1074,6 +1075,8 @@ def create_install_madlib_sqlfile(args, madpack_cmd, testcase):
         if madpack_cmd in ('uninstall', 'reinstall'):
             return_signal, is_schema_in_db = _append_uninstall_madlib_sqlfile(
                 schema, db_madlib_ver, is_schema_in_db, output_filehandle)
+            if return_signal == 1:
+                return 1
 
         # COMMAND: install/reinstall
         if madpack_cmd in ('install', 'reinstall'):