Bug 727395 - pysnmp lacking python-pyasn1 as a dependency, thus pysnmp sample code fails
Summary: pysnmp lacking python-pyasn1 as a dependency, thus pysnmp sample code fails
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pysnmp
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fabian Affolter
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-02 02:56 UTC by Glen Turner
Modified: 2012-03-04 15:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-04 11:10:16 UTC
Type: ---


Attachments (Terms of Use)

Description Glen Turner 2011-08-02 02:56:07 UTC
Description of problem:

pysnmp does not list python-asn1 as a dependency.

Thus the pysnmp sample code at
http://pysnmp.sourceforge.net/docs/4.x/
demonstrating a SNMP Get fails. This code begins with

from pysnmp.entity.rfc3413.oneliner import cmdgen

That line causes a failure until python-pyasn1 is manually installed.


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

$ rpm --query pysnmp
pysnmp-4.1.14-2.a.fc15.noarch

How reproducible:

Install pysnmp and attempt to use it in python code.


Steps to Reproduce:
1. sudo yum install pysnmp
2. python
3. from pysnmp.entity.rfc3413.oneliner import cmdgen
  
Actual results:

$ python
Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16) 
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pysnmp.entity.rfc3413.oneliner import cmdgen
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pysnmp/entity/rfc3413/oneliner/cmdgen.py", line 2, in <module>
    from pysnmp.entity import engine, config
  File "/usr/lib/python2.7/site-packages/pysnmp/entity/engine.py", line 2, in <module>
    from pysnmp.proto.rfc3412 import MsgAndPduDispatcher
  File "/usr/lib/python2.7/site-packages/pysnmp/proto/rfc3412.py", line 3, in <module>
    from pysnmp.smi import builder, instrum
  File "/usr/lib/python2.7/site-packages/pysnmp/smi/builder.py", line 4, in <module>
    from pysnmp.smi import error
  File "/usr/lib/python2.7/site-packages/pysnmp/smi/error.py", line 1, in <module>
    from pyasn1.error import PyAsn1Error
ImportError: No module named pyasn1.error 

Expected results:

pysnmp imports without error and pysnmp sample code works.

Additional info:

The package python-pyasn1 is not listed as a dependency of the package pysnmp.

$ rpm --query --requires pysnmp
/bin/sh  
/usr/bin/python  
net-snmp  
python(abi) = 2.7
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsXz) <= 5.2-1

As a workaround, manually install python-pyasn1:

$ sudo yum install python-pyasn1

Comment 1 Fedora Update System 2011-11-26 15:02:31 UTC
pysnmp-4.2.2-1.rc1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/pysnmp-4.2.2-1.rc1.fc16

Comment 2 Fedora Update System 2011-11-26 23:00:26 UTC
Package pysnmp-4.2.2-1.rc1.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing pysnmp-4.2.2-1.rc1.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-16447/pysnmp-4.2.2-1.rc1.fc16
then log in and leave karma (feedback).

Comment 3 Glen Turner 2011-11-28 00:48:55 UTC
Hi Fabian,

Is there an updated pyasn1 as well? I get unhappiness when testing just the release candidate RPM (I had to download it from the build system as it isn't on the mirrors yet). Running F15 with current updates.

# yum remove pysnmp python-pyasn1
# yum localinstall pysnmp-4.2.2-1.rc1.fc16.noarch.rpm
Installed: pysnmp.noarch 0:4.2.2-1.rc1.fc16
Dependency Installed: python- pyasn1.noarch 0:0.0.12a-2.fc15

Applying the test case:
$ python
Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16) [GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pysnmp.entity.rfc3413.oneliner import cmdgen
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pysnmp/entity/rfc3413/oneliner/cmdgen.py", line 2, in <module>
    from pysnmp.entity import engine, config
  File "/usr/lib/python2.7/site-packages/pysnmp/entity/engine.py", line 2, in <module>
    from pysnmp.proto.rfc3412 import MsgAndPduDispatcher
  File "/usr/lib/python2.7/site-packages/pysnmp/proto/rfc3412.py", line 3, in <module>
    from pyasn1.compat.octets import null
ImportError: No module named compat.octets

It's quite possible I'm doing something silly, since I'm a network engineer more than a a Python programmer or Fedora hacker.

Thanks, Glen

Comment 4 Fabian Affolter 2012-03-04 11:10:16 UTC
python-pyasn1 0.1.2 is only available for > F16. For me, it's working.

Comment 5 Glen Turner 2012-03-04 15:50:33 UTC
Apologies, I'd failed to see that Fedora 16 had released during the life of this bug. I'll do a clean install on a VM and test.


Note You need to log in before you can comment on or make changes to this bug.