You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by "Di Li (JIRA)" <ji...@apache.org> on 2015/05/06 20:21:00 UTC

[jira] [Created] (AMBARI-10968) ambari_server/utils.py should be able to parse version with postfix text

Di Li created AMBARI-10968:
------------------------------

             Summary: ambari_server/utils.py should be able to parse version with postfix text
                 Key: AMBARI-10968
                 URL: https://issues.apache.org/jira/browse/AMBARI-10968
             Project: Ambari
          Issue Type: Bug
          Components: ambari-server
    Affects Versions: 2.0.0
            Reporter: Di Li
            Assignee: Di Li


Apache ambari 2.0 has version "2.0.0" in the version file "/var/lib/ambari-server/resources/version". 

Since ambari is open source, it can be built with version information that has digits plus postfix like "2.0.0._MyCompany" in the version file "/var/lib/ambari-server/resources/version"

This postfix text causes the "ambari-server upgrade" cmd to fail with an int parser err thrown from the python script

INFO: Loading properties from /etc/ambari-server/conf/ambari.properties
Traceback (most recent call last):
  File "/usr/sbin/ambari-server.py", line 608, in <module>
    mainBody()
  File "/usr/sbin/ambari-server.py", line 596, in mainBody
    main(options, args, parser)
  File "/usr/sbin/ambari-server.py", line 562, in main
    action_obj.execute()
  File "/usr/sbin/ambari-server.py", line 58, in execute
    self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python2.6/site-packages/ambari_server/serverUpgrade.py", line 320, in upgrade
    elif compare_versions(ambari_version, "2.0.0") == 0:
  File "/usr/lib/python2.6/site-packages/ambari_server/utils.py", line 248, in compare_versions
    return cmp(normalize(version1), normalize(version2))
  File "/usr/lib/python2.6/site-packages/ambari_server/utils.py", line 247, in normalize
    return [int(x) for x in re.sub(r'(\.0+)*$', '', v).split(".")]
ValueError: invalid literal for int() with base 10: '0_MyCompany'



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)