I'd love to be able to use this module, but I have an unresolvable name conflict with an existing dns module. ciscoconfparse uses relative imports, and since my app is higher on the PYTHONPATH this means my dns module is being loaded in preference to the ciscoconfparse internal one.
>>> print "\n".join(sys.path)
/home/ben/projects/hdb/hdb
/usr/lib/entropy/lib
/home/ben/.virtualenvs/hdb/lib64/python27.zip
/home/ben/.virtualenvs/hdb/lib64/python2.7
/home/ben/.virtualenvs/hdb/lib64/python2.7/plat-linux2
/home/ben/.virtualenvs/hdb/lib64/python2.7/lib-tk
/home/ben/.virtualenvs/hdb/lib64/python2.7/lib-old
/home/ben/.virtualenvs/hdb/lib64/python2.7/lib-dynload
/usr/lib64/python2.7
/usr/lib/python2.7/plat-linux2
/usr/lib64/python2.7/lib-tk
/usr/lib/python2.7/lib-tk
/home/ben/.virtualenvs/hdb/lib/python2.7/site-packages
>>> from ciscoconfparse import CiscoConfParse
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/ben/.virtualenvs/hdb/lib/python2.7/site-packages/ciscoconfparse/__init__.py", line 1, in <module>
from ciscoconfparse import *
File "/home/ben/.virtualenvs/hdb/lib/python2.7/site-packages/ciscoconfparse/ciscoconfparse.py", line 11, in <module>
from models_cisco import IOSHostnameLine, IOSRouteLine, IOSIntfLine
File "/home/ben/.virtualenvs/hdb/lib/python2.7/site-packages/ciscoconfparse/models_cisco.py", line 5, in <module>
from ccp_util import _IPV6_REGEX_STR_COMPRESSED1, _IPV6_REGEX_STR_COMPRESSED2
File "/home/ben/.virtualenvs/hdb/lib/python2.7/site-packages/ciscoconfparse/ccp_util.py", line 8, in <module>
from dns.exception import DNSException
ImportError: No module named exception
If ciscoconfparse used absolute imports instead, I think this problem could be avoided. Short of renaming the local module in my application (not simple), I don't think there's any way I can work around it without code changes in ciscoconfparse.
I'd love to be able to use this module, but I have an unresolvable name conflict with an existing
dns
module.ciscoconfparse
uses relative imports, and since my app is higher on the PYTHONPATH this means mydns
module is being loaded in preference to theciscoconfparse
internal one.If
ciscoconfparse
used absolute imports instead, I think this problem could be avoided. Short of renaming the local module in my application (not simple), I don't think there's any way I can work around it without code changes inciscoconfparse
.