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: us...@infra.apache.org With regards, Apache Git Services