[ 
https://issues.apache.org/jira/browse/AMBARI-24763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16647752#comment-16647752
 ] 

ASF GitHub Bot commented on AMBARI-24763:
-----------------------------------------

oleewere closed pull request #5: AMBARI-24763. Infra Solr upgrade (2.7.x): 
ValueError: invalid literal for float():
URL: https://github.com/apache/ambari-infra/pull/5
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Infra Solr upgrade (2.7.x): ValueError: invalid literal for float():
> --------------------------------------------------------------------
>
>                 Key: AMBARI-24763
>                 URL: https://issues.apache.org/jira/browse/AMBARI-24763
>             Project: Ambari
>          Issue Type: Bug
>    Affects Versions: 2.7.0
>            Reporter: Olivér Szabó
>            Assignee: Olivér Szabó
>            Priority: Blocker
>              Labels: pull-request-available
>             Fix For: 2.7.3
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> exception:
> {code:java}
> File "/usr/lib/ambari-infra-solr-client/migrationHelper.py", line 951, in 
> parse_size 
> return int(float(number)*units[unit]) 
> ValueError: invalid literal for float(): 1,013.88 
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to