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:26:15 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 38cbda882 -> c143be331


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/c143be33
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/c143be33
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/c143be33

Branch: refs/heads/trunk
Commit: c143be331f670da3aef2451ed6d3fe1b41c6d8c4
Parents: 38cbda8
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:26:05 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/c143be33/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 5886561..348d5df 100644
--- a/ambari-server/src/main/python/ambari_server/utils.py
+++ b/ambari-server/src/main/python/ambari_server/utils.py
@@ -105,12 +105,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
 
 
@@ -132,12 +134,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