You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by ok...@apache.org on 2022/03/03 15:21:09 UTC

[madlib] 02/03: Add error checking for pg_ctl, gpconfig and gpstop

This is an automated email from the ASF dual-hosted git repository.

okislal pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/madlib.git

commit 496ce5d485a5a5a7673a445988cb7561fb4ab31c
Author: Orhan Kislal <ok...@apache.org>
AuthorDate: Thu Feb 24 18:50:01 2022 -0500

    Add error checking for pg_ctl, gpconfig and gpstop
---
 src/madpack/madpack.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/madpack/madpack.py b/src/madpack/madpack.py
index 9380715..d7982be 100755
--- a/src/madpack/madpack.py
+++ b/src/madpack/madpack.py
@@ -1311,15 +1311,19 @@ def set_dynamic_library_path_in_database(dbver_split, madlib_library_path):
 
         if portid == 'greenplum':
             if is_rev_gte(dbver_split, get_rev_num('6.0')):
-                os.system('gpconfig -c dynamic_library_path -v \'{0}\''.format(dynamic_library_path))
+                ret = os.system('gpconfig -c dynamic_library_path -v \'{0}\''.format(dynamic_library_path))
             else:
-                os.system('gpconfig -c dynamic_library_path -v \'\\{0}\''.format(dynamic_library_path))
-            os.system('gpstop -u')
+                ret = os.system('gpconfig -c dynamic_library_path -v \'\\{0}\''.format(dynamic_library_path))
+            ret = ret + os.system('gpstop -u')
+            if ret != 0:
+                error_(this, "cannot run gpconfig or gpstop", True)
         else:
             _internal_run_query(
                 "ALTER SYSTEM SET dynamic_library_path TO '{0}'".format(dynamic_library_path), True)
             pg_data_directory = _internal_run_query("SHOW data_directory", True)[0]['data_directory']
-            os.system('pg_ctl -D {0} reload'.format(pg_data_directory))
+            ret = os.system('pg_ctl -D {0} reload'.format(pg_data_directory))
+            if ret != 0:
+                error_(this, "cannot run pg_ctl", True)
 
 
 def main(argv):