This is an automated email from the ASF dual-hosted git repository.

oleewere pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ambari-infra.git


The following commit(s) were added to refs/heads/master by this push:
     new f9f02c6  AMBARI-24763. Infra Solr upgrade (2.7.x): ValueError: invalid 
literal for float(): (#5)
f9f02c6 is described below

commit f9f02c6f13f0247e3e2b3c39f7ed0aa0c29563d6
Author: Olivér Szabó <oleew...@gmail.com>
AuthorDate: Fri Oct 12 12:26:35 2018 +0200

    AMBARI-24763. Infra Solr upgrade (2.7.x): ValueError: invalid literal for 
float(): (#5)
    
    * AMBARI-24763. Infra Solr upgrade (2.7.x): ValueError: invalid literal for 
float():
    
    * AMBARI-24763. Add locale.setlocale
---
 ambari-infra-solr-client/src/main/python/migrationHelper.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ambari-infra-solr-client/src/main/python/migrationHelper.py 
b/ambari-infra-solr-client/src/main/python/migrationHelper.py
index 8e7112e..96a0206 100755
--- a/ambari-infra-solr-client/src/main/python/migrationHelper.py
+++ b/ambari-infra-solr-client/src/main/python/migrationHelper.py
@@ -946,9 +946,11 @@ def human_size(size_bytes):
   return "%s %s" % (formatted_size, suffix)
 
 def parse_size(human_size):
+  import locale
   units = {"bytes": 1, "KB": 1024, "MB": 1024**2, "GB": 1024**3, "TB": 1024**4 
}
   number, unit = [string.strip() for string in human_size.split()]
-  return int(float(number)*units[unit])
+  locale.setlocale(locale.LC_ALL,'')
+  return int(locale.atof(number)*units[unit])
 
 def get_replica_index_size(config, core_url, replica):
   request = CORE_DETAILS_URL.format(core_url)

Reply via email to