[zanata-users] Can not push strings

James Ni jni at redhat.com
Sat Jun 23 15:44:57 UTC 2012


----- Original Message -----
> On 06/22/2012 09:15 AM, Bryan Kearney wrote:
> > I am on f7 and attempting to push strings and get this error:
> >
> > bkearney at bkearney po]$ zanata list
> > Loading zanata project config from:
> > /home/bkearney/code/subscription-manager/po/zanata.xml
> > error: Server presented certificate that does not match host
> > translate.zanata.org:
> >
> > Is there server SSL configged correctly?
> >
> 
> I fixed this error by upgrading python-httplib2 to
> python-httplib2-0.7.4-4.fc17 from -testing.
> 
> But, then it starts complaining about not being
> able to read my .config/zanata.ini.
> 
> [adrian at dhcp231-28 po (master *)]$ zanata po pull --srcdir  ..
> Loading zanata project config from:
> /home/adrian/src/subscription-manager/po/zanata.xml
> Loading zanata user config from: /home/adrian/.config/zanata.ini
> zanata server: https://translate.zanata.org/zanata
> zanata python client version: 1.3.5, zanata server API version: 1.5.0
> error: Please specify username and apikey in zanata.ini or with
> '--username' and '--apikey' options
> 
> my (slightly redacted) .config/zanata.ini:
> [servers]
> internal.url = http://translate.zanata.org/zanata/
> internal.username = alikins
> internal.key = APIKEY

Hi Adrian, 

I notice in your zanata.ini "internal.url = http://translate.zanata.org/zanata/", it should be https. It is a slightly difference to url in zanata.xml. Please modify the zanata.ini, then the problem should be solved. I have tested 1.3.5 with https://translate.zanata.org/zanata using po push/po pull command and it is still working OK with python-httplib2-0.7.4-4. 

> our zanata.xml:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <config xmlns="http://zanata.org/namespace/config/">
> <url>https://translate.zanata.org/zanata/</url>
> <project>subscription-manager</project>
> <project-version>1.0.X</project-version>
> <locales>
> <locale>as</locale>
> <locale>bn-IN</locale>
> <locale>de-DE</locale>
> <locale>es-ES</locale>
> <locale>fr</locale>
> <locale>gu</locale>
> <locale>hi</locale>
> <locale>it</locale>
> <locale>ja</locale>
> <locale>kn</locale>
> <locale>ko</locale>
> <locale>ml</locale>
> <locale>mr</locale>
> <locale>or</locale>
> <locale>pa</locale>
> <locale>pt-BR</locale>
> <locale>ru</locale>
> <locale>ta-IN</locale>
> <locale>te</locale>
> <locale map-from="zh_CN">zh-Hans-CN</locale>
> <locale map-from="zh_TW">zh-Hant-TW</locale>
> </locales>
> </config>
> 
> 
> So I tried upgrading to the zanata-python-client from
> -testing as well (zanata-python-client-1.3.7-1)
> 
> [adrian at dhcp231-28 po (master *)]$ zanata po pull --srcdir  ..
> Loading zanata project config from:
> /home/adrian/src/subscription-manager/po/zanata.xml
> Traceback (most recent call last):
>    File "/usr/bin/zanata", line 25, in <module>
>      zanata.run()
>    File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py",
>    line
> 945, in run
>      program_name=os.path.split(sys.argv[0])[1],
>    File "/usr/lib/python2.6/site-packages/zanataclient/command.py",
>    line
> 339, in handle_program
>      command(command_options, args)
>    File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py",
>    line
> 695, in po_pull
>      pull(command_options, args, "gettext")
>    File "/usr/lib/python2.6/site-packages/zanataclient/zanata.py",
>    line
> 820, in pull
>      command.run(command_options, args, project_type)
>    File "/usr/lib/python2.6/site-packages/zanataclient/pullcmd.py",
>    line
> 64, in run
>      url, project_id, version_id, project_type, project_config =
> self.get_projectinfo(command_options)
>    File "/usr/lib/python2.6/site-packages/zanataclient/pushcmd.py",
>    line
> 328, in get_projectinfo
>      return url, project_id, version_id, project_type, project_config
> UnboundLocalError: local variable 'project_type' referenced before
> assignment
> 
> 
> So, I tried to install the version from master branch on github
> (https://github.com/zanata/zanata-python-client)
> 
> 
> Loading zanata project config from:
> /home/adrian/src/subscription-manager/po/zanata.xml
> Traceback (most recent call last):
>    File "/usr/bin/zanata", line 5, in <module>
>      pkg_resources.run_script('zanata-python-client==1.3.7-1-g9eb9',
> 'zanata')
>    File "/usr/lib/python2.6/site-packages/pkg_resources.py", line
>    461,
> in run_script
>      self.require(requires)[0].run_script(script_name, ns)
>    File "/usr/lib/python2.6/site-packages/pkg_resources.py", line
>    1194,
> in run_script
>      execfile(script_filename, namespace, namespace)
>    File
> "/usr/lib/python2.6/site-packages/zanata_python_client-1.3.7_1_g9eb9-py2.6.egg/EGG-INFO/scripts/zanata",
> line 25, in <module>
>      zanata.run()
>    File
> "/usr/lib/python2.6/site-packages/zanata_python_client-1.3.7_1_g9eb9-py2.6.egg/zanataclient/zanata.py",
> line 945, in run
>      program_name=os.path.split(sys.argv[0])[1],
>    File
> "/usr/lib/python2.6/site-packages/zanata_python_client-1.3.7_1_g9eb9-py2.6.egg/zanataclient/command.py",
> line 339, in handle_program
>      command(command_options, args)
>    File
> "/usr/lib/python2.6/site-packages/zanata_python_client-1.3.7_1_g9eb9-py2.6.egg/zanataclient/zanata.py",
> line 695, in po_pull
>      pull(command_options, args, "gettext")
>    File
> "/usr/lib/python2.6/site-packages/zanata_python_client-1.3.7_1_g9eb9-py2.6.egg/zanataclient/zanata.py",
> line 820, in pull
>      command.run(command_options, args, project_type)
>    File
> "/usr/lib/python2.6/site-packages/zanata_python_client-1.3.7_1_g9eb9-py2.6.egg/zanataclient/pullcmd.py",
> line 64, in run
>      url, project_id, version_id, project_type, project_config =
> self.get_projectinfo(command_options)
>    File
> "/usr/lib/python2.6/site-packages/zanata_python_client-1.3.7_1_g9eb9-py2.6.egg/zanataclient/pushcmd.py",
> line 328, in get_projectinfo
>      return url, project_id, version_id, project_type, project_config
> UnboundLocalError: local variable 'project_type' referenced before
> assignment
> 
> 
> (ie, the same error)
> 
> I was able to work around it with:
> 
>   zanata po pull --username alikins --apikey $APIKEYHERE
>   --project-type
> gettext --srcdir  ..
> 
> zanataclient/pushcmd.py expects project_type to be defined, but it is
> not in our
> zanata.xml (nor the one provided directly from translate.zanata.org).
> Adding
> a project type of 'gettext' to the zanata.xml seems to fix that
> error.

I am sorry about that, that is a issue imported by me in 1.3.7, i have fixed the issue and push to master branch on github. 
So please still using 1.3.5 now, and i will try to make a new release as soon as possible. Thanks.

> For reasons undetermined, it still seems to fail to read my
> zanata.ini
> 
> Help?
> 
> Adrian
> 
> _______________________________________________
> zanata-users mailing list
> zanata-users at redhat.com
> https://www.redhat.com/mailman/listinfo/zanata-users
> 




More information about the zanata-users mailing list