Bug 706815

Summary: zanata-python-client does not handle version in format x.y.z
Product: [Retired] Zanata Reporter: Ding-Yi Chen <dchen>
Component: Component-PythonClientAssignee: zanata-dev-internal <zanata-dev-internal>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 1.3CC: jni, zanata-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-27 04:30:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ding-Yi Chen 2011-05-23 06:13:41 UTC
Description of problem:

It seems like zanata-python-client pass version with string.atof(version).
However, if version is in format x.y.z (e.g. 1.3.1), the zanata-python-client fail with error like:

Traceback (most recent call last):
  File "/usr/bin/zanata", line 26, in <module>
    client.run()
  File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py", line 1483, in run
    self._create_iteration(command_args)
  File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py", line 387, in _create_iteration
    version_number = string.atof(version)
  File "/usr/lib64/python2.6/string.py", line 388, in atof
    return _float(s)
ValueError: invalid literal for float(): 1.3.1


Version-Release number of selected component (if applicable):
zanata-python-client


How reproducible:
Always

Steps to Reproduce:
1. Assume zanata.xml exists.
2. zanata version create 1 --url=<zanataServerUrl>
  
Actual results:
  File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py", line 387, in _create_iteration
    version_number = string.atof(version)
  File "/usr/lib64/python2.6/string.py", line 388, in atof
    return _float(s)
ValueError: invalid literal for float(): 1.3.1


Expected results:
Proceed without error

Comment 1 James Ni 2011-05-25 08:25:12 UTC
Hi Dean,

I have modify the source code to fix this issue, you can check the commit 931bb6ed in devel branch of zanataclient to verify this issue. (I forget to add the bug number to commit, sorry for that!)

Best Regards

Comment 2 Ding-Yi Chen 2011-05-26 04:22:42 UTC
VERIFIED with commit 931bb6ed454d207a93e88b4a0e19713671741510

Please fill this bug number in when you submit the release to bodhi.