ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject git commit: AMBARI-8071. Unable to start services after 1.6.1 -> 1.7.0 upgrade. (Andrew O via mahadev)
Date Fri, 31 Oct 2014 21:35:28 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 605ee38b8 -> e3e63f61c


AMBARI-8071. Unable to start services after 1.6.1 -> 1.7.0 upgrade. (Andrew O via mahadev)


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

Branch: refs/heads/branch-1.7.0
Commit: e3e63f61cdc817395e223ceb69fb2e980f7f32ab
Parents: 605ee38
Author: Mahadev Konar <mahadev@apache.org>
Authored: Fri Oct 31 14:34:38 2014 -0700
Committer: Mahadev Konar <mahadev@apache.org>
Committed: Fri Oct 31 14:35:17 2014 -0700

----------------------------------------------------------------------
 .../libraries/functions/format_jvm_option.py    | 21 ++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e3e63f61/ambari-common/src/main/python/resource_management/libraries/functions/format_jvm_option.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/format_jvm_option.py
b/ambari-common/src/main/python/resource_management/libraries/functions/format_jvm_option.py
index 7182fb9..49a1903 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/format_jvm_option.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/format_jvm_option.py
@@ -28,7 +28,20 @@ from resource_management.libraries.functions import *
 
 def format_jvm_option(name, default_value):
   curr_dict = default(name, default_value)
-  if not "m" in curr_dict:
-    curr_dict = curr_dict + m
-  
-  return curr_dict
\ No newline at end of file
+  if isinstance(curr_dict, ( int, long )):
+    curr_dict = str(curr_dict) + "m"
+    return curr_dict
+  elif isinstance(curr_dict, str):
+    if curr_dict.strip() == "":
+      return default_value
+    elif curr_dict.strip() != "":
+      if "m" in curr_dict:
+        return curr_dict
+      else:
+        if isinstance(int(curr_dict), ( int, long )): 
+          return str(int(curr_dict)) + "m"
+        else:
+          return default_value
+  else:
+    return default_value
+    
\ No newline at end of file


Mime
View raw message