ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Di Li" <>
Subject Re: Review Request 34269: ambari_server/ should be able to parse version with postfix text
Date Fri, 22 May 2015 18:28:16 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated May 22, 2015, 6:28 p.m.)

Review request for Ambari and Alejandro Fernandez.

Bugs: AMBARI-10968

Repository: ambari


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/
Traceback (most recent call last):
File "/usr/sbin/", line 608, in <module>
File "/usr/sbin/", line 596, in mainBody
main(options, args, parser)
File "/usr/sbin/", line 562, in main
File "/usr/sbin/", line 58, in execute
self.fn(*self.args, **self.kwargs)
File "/usr/lib/python2.6/site-packages/ambari_server/", line 320, in upgrade
elif compare_versions(ambari_version, "2.0.0") == 0:
File "/usr/lib/python2.6/site-packages/ambari_server/", line 248, in compare_versions
return cmp(normalize(version1), normalize(version2))
File "/usr/lib/python2.6/site-packages/ambari_server/", 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'


  ambari-server/src/main/python/ambari_server/ f09a95c 
  ambari-server/src/test/python/ bbd40bf 



test_compare_versions (TestUtils.TestUtils) ... ok
... ...
Ran 265 tests in 7.355s

Total run:773
Total errors:0
Total failures:0


Di Li

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message