ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-18760 ambari-server.pid might not be created (dsen)
Date Tue, 01 Nov 2016 17:34:35 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 db618b29c -> 7077ccb37


AMBARI-18760 ambari-server.pid might not be created (dsen)


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

Branch: refs/heads/branch-2.4
Commit: 7077ccb37c9fd138cca5dbd203d0a61099796a36
Parents: db618b2
Author: Dmytro Sen <dsen@apache.org>
Authored: Tue Nov 1 19:26:05 2016 +0200
Committer: Dmytro Sen <dsen@apache.org>
Committed: Tue Nov 1 19:31:53 2016 +0200

----------------------------------------------------------------------
 ambari-server/src/main/python/ambari_server/utils.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7077ccb3/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 012d428..5f0a64d 100644
--- a/ambari-server/src/main/python/ambari_server/utils.py
+++ b/ambari-server/src/main/python/ambari_server/utils.py
@@ -103,12 +103,14 @@ def save_pid(pid, pidfile):
   try:
     pfile = open(pidfile, "w")
     pfile.write("%s\n" % pid)
-  except IOError:
+  except IOError as e:
+    print_error_msg("Failed to write PID to " + pidfile + " due to " + str(e))
     pass
   finally:
     try:
       pfile.close()
-    except:
+    except Exception as e:
+      print_error_msg("Failed to close PID file " + pidfile + " due to " + str(e))
       pass
 
 
@@ -130,12 +132,14 @@ def save_main_pid_ex(pids, pidfile, exclude_list=[], kill_exclude_list=False,
sk
           os.kill(int(item["pid"]), signal.SIGKILL)
         except:
           pass
-  except IOError:
+  except IOError as e:
+    print_error_msg("Failed to write PID to " + pidfile + " due to " + str(e))
     pass
   finally:
     try:
       pfile.close()
-    except:
+    except Exception as e:
+      print_error_msg("Failed to close PID file " + pidfile + " due to " + str(e))
       pass
 
 


Mime
View raw message