You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mp...@apache.org on 2017/10/04 20:36:29 UTC

[1/2] ambari git commit: AMBARI-22122. ambari server silent setup for embedded database option fails sometime. (mpapirkovskyy)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.6 84ae9a0b2 -> 710c93065
  refs/heads/trunk 1da77356b -> fc58250f7


AMBARI-22122. ambari server silent setup for embedded database option fails sometime. (mpapirkovskyy)


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

Branch: refs/heads/branch-2.6
Commit: 710c93065e470e07cbe6fa248c0d0e6c3532b428
Parents: 84ae9a0
Author: Myroslav Papirkovskyi <mp...@hortonworks.com>
Authored: Wed Oct 4 23:26:18 2017 +0300
Committer: Myroslav Papirkovskyi <mp...@hortonworks.com>
Committed: Wed Oct 4 23:26:55 2017 +0300

----------------------------------------------------------------------
 .../src/main/python/ambari_server/dbConfiguration_linux.py  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/710c9306/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
index 1142d25..51d4759 100644
--- a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
+++ b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
@@ -350,6 +350,7 @@ class PGConfig(LinuxDBMSConfig):
 
   PG_ERROR_BLOCKED = "is being accessed by other users"
   PG_STATUS_RUNNING = None
+  PG_STATUS_STOPPED = "stopped"
   SERVICE_CMD = "/usr/bin/env service"
   PG_SERVICE_NAME = "postgresql"
   PG_HBA_DIR = None
@@ -607,12 +608,12 @@ class PGConfig(LinuxDBMSConfig):
     # on RHEL and SUSE PG_ST_COMD returns RC 0 for running and 3 for stoppped
     if retcode == 0:
       if out.strip() == "Running clusters:":
-        pg_status = "stopped"
+        pg_status = PGConfig.PG_STATUS_STOPPED
       else:
         pg_status = PGConfig.PG_STATUS_RUNNING
     else:
       if retcode == 3:
-        pg_status = "stopped"
+        pg_status = PGConfig.PG_STATUS_STOPPED
       else:
         pg_status = None
     return pg_status, retcode, out, err
@@ -751,7 +752,7 @@ class PGConfig(LinuxDBMSConfig):
     PGConfig._configure_postgresql_conf()
     #restart postgresql if already running
     pg_status, retcode, out, err = PGConfig._get_postgre_status()
-    if pg_status == PGConfig.PG_STATUS_RUNNING:
+    if pg_status != PGConfig.PG_STATUS_STOPPED:
       retcode, out, err = PGConfig._restart_postgres()
       return retcode, out, err
     return 0, "", ""
@@ -771,7 +772,7 @@ class PGConfig(LinuxDBMSConfig):
       process.kill()
       pg_status, retcode, out, err = PGConfig._get_postgre_status()
       # SUSE linux set status of stopped postgresql proc to unused
-      if pg_status == "unused" or pg_status == "stopped":
+      if pg_status == "unused" or pg_status == PGConfig.PG_STATUS_STOPPED:
         print_info_msg("PostgreSQL is stopped. Restarting ...")
         retcode, out, err = run_os_command(PGConfig.PG_START_CMD)
         return retcode, out, err


[2/2] ambari git commit: AMBARI-22122. ambari server silent setup for embedded database option fails sometime. (mpapirkovskyy)

Posted by mp...@apache.org.
AMBARI-22122. ambari server silent setup for embedded database option fails sometime. (mpapirkovskyy)


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

Branch: refs/heads/trunk
Commit: fc58250f7b0b551e0077a047a79813ea3f9bd4e1
Parents: 1da7735
Author: Myroslav Papirkovskyi <mp...@hortonworks.com>
Authored: Wed Oct 4 23:26:18 2017 +0300
Committer: Myroslav Papirkovskyi <mp...@hortonworks.com>
Committed: Wed Oct 4 23:36:11 2017 +0300

----------------------------------------------------------------------
 .../src/main/python/ambari_server/dbConfiguration_linux.py  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fc58250f/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
index 38dfa8c..2ac5325 100644
--- a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
+++ b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
@@ -354,6 +354,7 @@ class PGConfig(LinuxDBMSConfig):
 
   PG_ERROR_BLOCKED = "is being accessed by other users"
   PG_STATUS_RUNNING = None
+  PG_STATUS_STOPPED = "stopped"
   SERVICE_CMD = "/usr/bin/env service"
   PG_SERVICE_NAME = "postgresql"
   PG_HBA_DIR = None
@@ -611,12 +612,12 @@ class PGConfig(LinuxDBMSConfig):
     # on RHEL and SUSE PG_ST_COMD returns RC 0 for running and 3 for stoppped
     if retcode == 0:
       if out.strip() == "Running clusters:":
-        pg_status = "stopped"
+        pg_status = PGConfig.PG_STATUS_STOPPED
       else:
         pg_status = PGConfig.PG_STATUS_RUNNING
     else:
       if retcode == 3:
-        pg_status = "stopped"
+        pg_status = PGConfig.PG_STATUS_STOPPED
       else:
         pg_status = None
     return pg_status, retcode, out, err
@@ -750,7 +751,7 @@ class PGConfig(LinuxDBMSConfig):
     PGConfig._configure_postgresql_conf()
     #restart postgresql if already running
     pg_status, retcode, out, err = PGConfig._get_postgre_status()
-    if pg_status == PGConfig.PG_STATUS_RUNNING:
+    if pg_status != PGConfig.PG_STATUS_STOPPED:
       retcode, out, err = PGConfig._restart_postgres()
       return retcode, out, err
     return 0, "", ""
@@ -770,7 +771,7 @@ class PGConfig(LinuxDBMSConfig):
       process.kill()
       pg_status, retcode, out, err = PGConfig._get_postgre_status()
       # SUSE linux set status of stopped postgresql proc to unused
-      if pg_status == "unused" or pg_status == "stopped":
+      if pg_status == "unused" or pg_status == PGConfig.PG_STATUS_STOPPED:
         print_info_msg("PostgreSQL is stopped. Restarting ...")
         retcode, out, err = run_os_command(PGConfig.PG_START_CMD)
         return retcode, out, err