You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2016/12/02 09:46:14 UTC

[1/2] ambari git commit: AMBARI-19061. Ambari-server restart command not working. if any parameters are changed and reset to default. (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 590d4f9b8 -> 6fbbabfcb
  refs/heads/trunk c2dc7538b -> 2de7ee8d0


AMBARI-19061. Ambari-server restart command not working. if any parameters are changed and reset to default.  (aonishuk)


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

Branch: refs/heads/trunk
Commit: 2de7ee8d01ce850bbbf9844ad8789615b6570168
Parents: c2dc753
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Fri Dec 2 11:45:57 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Fri Dec 2 11:45:57 2016 +0200

----------------------------------------------------------------------
 .../src/main/python/ambari_server/utils.py      | 23 ++++++++++----------
 1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2de7ee8d/ambari-server/src/main/python/ambari_server/utils.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/utils.py b/ambari-server/src/main/python/ambari_server/utils.py
index 26e59ae..fc631f5 100644
--- a/ambari-server/src/main/python/ambari_server/utils.py
+++ b/ambari-server/src/main/python/ambari_server/utils.py
@@ -127,17 +127,18 @@ def save_main_pid_ex(pids, pidfile, exclude_list=[], skip_daemonize=False):
   """
   pid_saved = False
   try:
-    pfile = open(pidfile, "w")
-    for item in pids:
-      if pid_exists(item["pid"]) and (item["exe"] not in exclude_list):
-        pfile.write("%s\n" % item["pid"])
-        pid_saved = True
-        logger.info("Ambari server started with PID " + str(item["pid"]))
-      if pid_exists(item["pid"]) and (item["exe"] in exclude_list) and not skip_daemonize:
-        try:
-          os.kill(int(item["pid"]), signal.SIGKILL)
-        except:
-          pass
+    if pids:
+      pfile = open(pidfile, "w")
+      for item in pids:
+        if pid_exists(item["pid"]) and (item["exe"] not in exclude_list):
+          pfile.write("%s\n" % item["pid"])
+          pid_saved = True
+          logger.info("Ambari server started with PID " + str(item["pid"]))
+        if pid_exists(item["pid"]) and (item["exe"] in exclude_list) and not skip_daemonize:
+          try:
+            os.kill(int(item["pid"]), signal.SIGKILL)
+          except:
+            pass
   except IOError as e:
     logger.error("Failed to write PID to " + pidfile + " due to " + str(e))
     pass


[2/2] ambari git commit: AMBARI-19061. Ambari-server restart command not working. if any parameters are changed and reset to default. (aonishuk)

Posted by ao...@apache.org.
AMBARI-19061. Ambari-server restart command not working. if any parameters are changed and reset to default.  (aonishuk)


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

Branch: refs/heads/branch-2.5
Commit: 6fbbabfcb70c3e55d92fd0e6660ae87e6fb83ce6
Parents: 590d4f9
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Fri Dec 2 11:46:00 2016 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Fri Dec 2 11:46:00 2016 +0200

----------------------------------------------------------------------
 .../src/main/python/ambari_server/utils.py      | 23 ++++++++++----------
 1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6fbbabfc/ambari-server/src/main/python/ambari_server/utils.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/utils.py b/ambari-server/src/main/python/ambari_server/utils.py
index 62c93ae..4c8304b 100644
--- a/ambari-server/src/main/python/ambari_server/utils.py
+++ b/ambari-server/src/main/python/ambari_server/utils.py
@@ -125,17 +125,18 @@ def save_main_pid_ex(pids, pidfile, exclude_list=[], skip_daemonize=False):
   """
   pid_saved = False
   try:
-    pfile = open(pidfile, "w")
-    for item in pids:
-      if pid_exists(item["pid"]) and (item["exe"] not in exclude_list):
-        pfile.write("%s\n" % item["pid"])
-        pid_saved = True
-        logger.info("Ambari server started with PID " + str(item["pid"]))
-      if pid_exists(item["pid"]) and (item["exe"] in exclude_list) and not skip_daemonize:
-        try:
-          os.kill(int(item["pid"]), signal.SIGKILL)
-        except:
-          pass
+    if pids:
+      pfile = open(pidfile, "w")
+      for item in pids:
+        if pid_exists(item["pid"]) and (item["exe"] not in exclude_list):
+          pfile.write("%s\n" % item["pid"])
+          pid_saved = True
+          logger.info("Ambari server started with PID " + str(item["pid"]))
+        if pid_exists(item["pid"]) and (item["exe"] in exclude_list) and not skip_daemonize:
+          try:
+            os.kill(int(item["pid"]), signal.SIGKILL)
+          except:
+            pass
   except IOError as e:
     logger.error("Failed to write PID to " + pidfile + " due to " + str(e))
     pass