marvin-zhao / pyang

Automatically exported from code.google.com/p/pyang
0 stars 0 forks source link

pyang issues on centos6 #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Simply using pyang on prompt will give error. Example $ pyang

What is the expected output? What do you see instead?
localhost.localdomain$ pyang 
Traceback (most recent call last):
  File "/usr/bin/pyang", line 403, in <module>
    run()
  File "/usr/bin/pyang", line 27, in run
    plugin.init(plugindirs)
  File "/usr/lib/python2.6/site-packages/pyang/plugin.py", line 35, in init
    pluginmod = __import__(fname[:-3])
  File "/usr/lib/python2.6/site-packages/pyang/plugins/jtox.py", line 49
    for m,p in unique_prefixes(ctx).items() }
      ^
SyntaxError: invalid syntax
localhost.localdomain$ 

What version of the product are you using? On what operating system?
I downloaded Version 1.5 and did "python setup.py install" on centos6.4 64 bit 
OS. I got following error:-
python setup.py install
running install
running build
running build_py
running build_scripts
running install_lib
byte-compiling /usr/lib/python2.6/site-packages/pyang/plugins/jtox.py to 
jtox.pyc
SyntaxError: ('invalid syntax', 
('/usr/lib/python2.6/site-packages/pyang/plugins/jtox.py', 49, 20, '            
     for m,p in unique_prefixes(ctx).items() }\n'))

byte-compiling 
/usr/lib/python2.6/site-packages/pyang/plugins/sample-xml-skeleton.py to 
sample-xml-skeleton.pyc
SyntaxError: ('invalid syntax', 
('/usr/lib/python2.6/site-packages/pyang/plugins/sample-xml-skeleton.py', 103, 
65, '        self.ns_uri = { yam : yam.search_one("namespace").arg for yam in 
modules }\n'))

running install_scripts
changing mode of /usr/bin/json2xml to 775
changing mode of /usr/bin/yang2dsdl to 775
changing mode of /usr/bin/pyang to 775
changing mode of /usr/bin/yang2html to 775
running install_data
running install_egg_info
Removing /usr/lib/python2.6/site-packages/pyang-1.5-py2.6.egg-info
Writing /usr/lib/python2.6/site-packages/pyang-1.5-py2.6.egg-info
[root@localhost pyang-1.5]# 

Please provide any additional information below.
) Linux Centos6.4 with kernel 2.6.32-431.29.2.el6.x86_64
) Python 2.6.6 (python-2.6.6-37.el6_4.x86_64)
) $ rpm -qa | grep libxml2
       libxml2-devel-2.7.6-17.el6_6.1.x86_64
       libxml2-python-2.7.6-17.el6_6.1.x86_64
       libxml2-2.7.6-17.el6_6.1.x86_64

I am a newbie here, so please advise me which version of python to use or any 
other dependencies. 

Original issue reported on code.google.com by ramangup...@gmail.com on 29 Dec 2014 at 10:40

GoogleCodeExporter commented 9 years ago
this plugin needs python 2.7.  this should be fixed. 

Original comment by mbj4...@gmail.com on 8 Jan 2015 at 7:57

GoogleCodeExporter commented 9 years ago
This is a duplicate of issue 116. It has been already fixed in the repository:

48,49c48,50
<         mods = { m.i_modulename : [p, m.search_one("namespace").arg]
<                  for m,p in unique_prefixes(ctx).items() }
---
>         mods = {}
>         for m,p in unique_prefixes(ctx).items():
>             mods[m.i_modulename] = [p, m.search_one("namespace").arg]

Otherwise, version 1.5 works with Python 2.7.

Original comment by lada.lho...@gmail.com on 9 Jan 2015 at 11:07