Bug 814503

Summary: backtrace for zanata glossary push without "zanata.xml"
Product: [Fedora] Fedora Reporter: Jens Petersen <petersen>
Component: zanata-python-clientAssignee: James Ni <jni>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dchen, jni, petersen
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python client version: 1.3.5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-14 02:14:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jens Petersen 2012-04-20 02:40:03 UTC
Description of problem:
Running "zanata glossary push" in a empty (non-zanata) dir say
gives a backtrace, not an error message.

Version-Release number of selected component (if applicable):
zanata-python-client-1.3.4-1.fc16

How reproducible:
every time

Steps to Reproduce:
$ mkdir test
$ cd test
$ zanata glossary push
  
Actual results:
Traceback (most recent call last):
  File "/usr/bin/zanata", line 25, in <module>
    zanata.run()
  File "/usr/lib/python2.7/site-packages/zanataclient/zanata.py", line 1369, in run
    program_name=os.path.split(sys.argv[0])[1],
  File "/usr/lib/python2.7/site-packages/zanataclient/command.py", line 339, in handle_program
    command(command_options, args)
  File "/usr/lib/python2.7/site-packages/zanataclient/zanata.py", line 1291, in glossary_push
    url, username, apikey = optionsutil.apply_configfiles()
  File "/usr/lib/python2.7/site-packages/zanataclient/optionsutil.py", line 41, in apply_configfiles
    url = self.apply_project_config()
  File "/usr/lib/python2.7/site-packages/zanataclient/optionsutil.py", line 66, in apply_project_config
    self.project_config = self.config.read_project_config(path)
  File "/usr/lib/python2.7/site-packages/zanataclient/parseconfig.py", line 74, in read_project_config
    if os.path.getsize(filename) == 0:
  File "/usr/lib64/python2.7/genericpath.py", line 49, in getsize
    return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: '/home/petersen/test/zanata.xml'

Expected results:
Just something like "Missing 'zanata.xml' file?

Additional info:
I think better to avoid backtraces and catch
errors like the above one with a friendly error message.

Comment 1 James Ni 2012-04-20 02:48:30 UTC
Hi Jens,

Thanks a lot, i also find this issue, sorry for the inconvenience. I think i should do more test before i add new feature to python client and release a new version. I have commit the fix to git-hub, 

https://github.com/zanata/zanata-python-client/commit/b3e6a94face80a737f44df81e579605dd81c5989

I will include this fix in the new release, thanks

Comment 2 Fedora Update System 2012-04-26 09:59:03 UTC
zanata-python-client-1.3.5-1.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.5-1.fc15

Comment 3 Fedora Update System 2012-04-26 09:59:30 UTC
zanata-python-client-1.3.5-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.5-1.el5

Comment 4 Fedora Update System 2012-04-26 09:59:54 UTC
zanata-python-client-1.3.5-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.5-1.fc16

Comment 5 Fedora Update System 2012-04-26 10:00:22 UTC
zanata-python-client-1.3.5-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.5-1.el6

Comment 6 Fedora Update System 2012-04-26 10:00:52 UTC
zanata-python-client-1.3.5-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.5-1.fc17

Comment 7 Fedora Update System 2012-05-29 16:22:18 UTC
zanata-python-client-1.3.5-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2012-05-29 21:53:50 UTC
zanata-python-client-1.3.5-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2012-05-29 21:56:19 UTC
zanata-python-client-1.3.5-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2012-05-31 01:14:26 UTC
zanata-python-client-1.3.5-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2012-05-31 01:14:58 UTC
zanata-python-client-1.3.5-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.