Bug 1194987

Summary: NameError: global name 'project_type' is not defined
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: zanata-python-clientAssignee: anish <apatil>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: apatil, camunoz, dchen, kent.neo, petersen, sflaniga
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: zanata-python-client-1.3.21-1.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-08 22:49:36 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 Richard W.M. Jones 2015-02-21 17:00:10 UTC
Description of problem:

$ zanata po pull
Loading zanata project config from: /home/rjones/d/hivex/zanata.xml
Warning, the url https://fedora.zanata.org/, contains / at end,please check your URL in zanata.xml
Loading zanata user config from: /home/rjones/.config/zanata.ini
zanata server: https://fedora.zanata.org
Loading zanata project config from: /home/rjones/d/hivex/zanata.xml
Loading zanata user config from: /home/rjones/.config/zanata.ini
zanata server: https://fedora.zanata.org
zanata python client version: UKNOWN, zanata server API version: 3.4.0
Project: hivex
Version: master
Username: rwmj
Source language: en-US
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 973, 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 719, in po_pull
    pull(command_options, args, "gettext")
  File "/usr/lib/python2.7/site-packages/zanataclient/zanata.py", line 475, in run_func
    command.run()
  File "/usr/lib/python2.7/site-packages/zanataclient/pullcmd.py", line 84, in run
    command_type = project_type
NameError: global name 'project_type' is not defined

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

zanata-python-client-1.3.18-1.fc22.noarch

How reproducible:

100%

Steps to Reproduce:
1. Use zanata po pull command on my 'hivex' project.

Comment 1 Richard W.M. Jones 2015-02-21 17:05:50 UTC
This simple-minded fix works for me, although I have no idea
if it is correct or not:

        if self.project_type:
-           command_type = project_type
+           command_type = self.project_type
            dir_option = True

Comment 2 Carlos Munoz 2015-02-23 00:28:03 UTC
Any ideas Anish?

Comment 3 Carlos Munoz 2015-02-23 00:30:33 UTC
Richard, the python client stopped being the main client for Zanata a while ago. We still do minor fixes here and there (thanks to Anish), but all new features go to the Java-based client. You can find more information here: http://zanata.org/help/cli/cli-install/

Comment 4 Jens Petersen 2015-02-23 03:54:11 UTC
Anish, can you please have a look?

Comment 5 anish 2015-02-23 05:12:12 UTC
Hi Richard W.M. Jones,

Thanks you for bug report and I am looking into it 


Thanks,
Anish P.

Comment 6 anish 2015-02-23 06:32:54 UTC
Hi Richard,

Thank you for your fix, project_type was local member in previous versions but now its a class variable 

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

Comment 7 Fedora Update System 2015-02-23 07:14:44 UTC
zanata-python-client-1.3.19-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.19-1.el7

Comment 8 Fedora Update System 2015-02-23 07:14:48 UTC
zanata-python-client-1.3.19-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.19-1.fc20

Comment 9 Fedora Update System 2015-02-23 07:14:53 UTC
zanata-python-client-1.3.19-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.19-1.fc21

Comment 10 Richard W.M. Jones 2015-02-23 08:38:52 UTC
The reason I'm not using the Java client is:

# yum install zanata-client
...
Total download size: 162 M
Installed size: 201 M

Comment 11 Fedora Update System 2015-02-23 16:09:58 UTC
Package zanata-python-client-1.3.19-1.el7:
* should fix your issue,
* was pushed to the Fedora EPEL 7 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing zanata-python-client-1.3.19-1.el7'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2015-0906/zanata-python-client-1.3.19-1.el7
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2015-03-02 09:55:22 UTC
zanata-python-client-1.3.20-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.20-1.fc22

Comment 13 Fedora Update System 2015-03-02 09:55:30 UTC
zanata-python-client-1.3.20-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.20-1.fc21

Comment 14 Fedora Update System 2015-03-02 09:55:35 UTC
zanata-python-client-1.3.20-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.20-1.el7

Comment 15 Fedora Update System 2015-03-02 09:56:44 UTC
zanata-python-client-1.3.20-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.20-1.el6

Comment 16 Fedora Update System 2015-03-02 09:56:50 UTC
zanata-python-client-1.3.20-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.20-1.fc20

Comment 17 Fedora Update System 2015-03-03 15:57:01 UTC
zanata-python-client-1.3.21-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.21-1.fc20

Comment 18 Fedora Update System 2015-03-03 15:58:13 UTC
zanata-python-client-1.3.21-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.21-1.fc21

Comment 19 Fedora Update System 2015-03-03 15:58:19 UTC
zanata-python-client-1.3.21-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.21-1.fc22

Comment 20 Fedora Update System 2015-03-03 15:58:26 UTC
zanata-python-client-1.3.21-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.21-1.el6

Comment 21 Fedora Update System 2015-03-03 15:58:33 UTC
zanata-python-client-1.3.21-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/zanata-python-client-1.3.21-1.el7

Comment 22 Fedora Update System 2015-03-08 22:49:36 UTC
zanata-python-client-1.3.21-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.

Comment 23 Fedora Update System 2015-04-22 18:45:06 UTC
zanata-python-client-1.3.21-1.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2015-04-23 16:06:00 UTC
zanata-python-client-1.3.21-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 25 Fedora Update System 2015-04-23 16:07:44 UTC
zanata-python-client-1.3.21-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 26 Fedora Update System 2015-04-23 16:09:34 UTC
zanata-python-client-1.3.21-1.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.