Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotADirectoryError: [Errno 20] Not a directory: #49

Open
faysal-ishtiaq opened this issue Jun 10, 2019 · 1 comment
Open

NotADirectoryError: [Errno 20] Not a directory: #49

faysal-ishtiaq opened this issue Jun 10, 2019 · 1 comment

Comments

@faysal-ishtiaq
Copy link

I installed pysmi from the master branch as following:

  • clone the repo and cd into it
  • pip install -r requirements.txt
  • python setup.py install
    then I tried:
    mibdump.py --destination-directory=/destination/path A3COM00xx-BRIDGE-EXT-MIB

which produces following output:

Source MIB repositories: file:///usr/share/snmp/mibs, http://mibs.snmplabs.com/asn1/@mib@
Borrow missing/failed MIBs from: http://mibs.snmplabs.com/pysnmp/notexts/@mib@
Existing/compiled MIB locations: pysnmp.smi.mibs, pysnmp_mibs
Compiled MIBs destination directory: /destination/path
MIBs excluded from code generation: INET-ADDRESS-MIB, PYSNMP-USM-MIB, RFC-1212, RFC-1215, RFC1065-SMI, RFC1155-SMI,
 RFC1158-MIB, RFC1213-MIB, SNMP-FRAMEWORK-MIB, SNMP-TARGET-MIB, SNMPv2-CONF, SNMPv2-SMI, SNMPv2-TC, SNMPv2-TM, TRAN
SPORT-ADDRESS-MIB
MIBs to compile: A3COM00xx-BRIDGE-EXT-MIB
Destination format: pysnmp
Custom destination template: None
Parser grammar cache directory: not used
Also compile all relevant MIBs: yes
Rebuild MIBs regardless of age: no
Dry run mode: no
Create/update MIBs: yes
Byte-compile Python modules: yes (optimization level no)
Ignore compilation errors: no
Generate OID->MIB index: no
Generate texts in MIBs: no
Keep original texts layout: no
Try various file names while searching for MIB module: yes
Traceback (most recent call last):
  File "mibdump.py", line 368, in <module>
    ignoreErrors=ignoreErrorsFlag)
  File "/home/faysal/PycharmProjects/pysmi/venv/lib/python3.6/site-packages/pysmi-0.4.0-py3.6.egg/pysmi/compiler.py
", line 358, in compile
  File "/home/faysal/PycharmProjects/pysmi/venv/lib/python3.6/site-packages/pysmi-0.4.0-py3.6.egg/pysmi/codegen/pys
nmp.py", line 153, in genCode
  File "/home/faysal/PycharmProjects/pysmi/venv/lib/python3.6/site-packages/jinja2/environment.py", line 830, in ge
t_template
    return self._load_template(name, self.make_globals(globals))
  File "/home/faysal/PycharmProjects/pysmi/venv/lib/python3.6/site-packages/jinja2/environment.py", line 804, in _l
oad_template
    template = self.loader.load(self, name, globals)
  File "/home/faysal/PycharmProjects/pysmi/venv/lib/python3.6/site-packages/jinja2/loaders.py", line 113, in load
    source, filename, uptodate = self.get_source(environment, name)
  File "/home/faysal/PycharmProjects/pysmi/venv/lib/python3.6/site-packages/jinja2/loaders.py", line 171, in get_so
urce
    f = open_if_exists(filename)
  File "/home/faysal/PycharmProjects/pysmi/venv/lib/python3.6/site-packages/jinja2/utils.py", line 154, in open_if_
exists
    return open(filename, mode)
NotADirectoryError: [Errno 20] Not a directory: '/home/faysal/PycharmProjects/pysmi/venv/lib/python3.6/site-package
s/pysmi-0.4.0-py3.6.egg/pysmi/codegen/templates/pysnmp/mib-definitions.j2'

output from "mibdump.py --version"

SNMP SMI/MIB library version 0.4.0, written by Ilya Etingof <etingof@gmail.com>
Python interpreter: 3.6.7 (default, Oct 22 2018, 11:32:17) 

@etingof
Copy link
Owner

etingof commented Jun 12, 2019

Commit 6760244 in master should have fixed this. Thank you for raising it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants