FairwindsOps / pentagon

A framework for building repeatable, containerized, cloud-based infrastructure as code with Kubernetes.
https://www.reactiveops.com
Apache License 2.0
183 stars 25 forks source link

Component import fails when another module with a similiar name is pip installed #127

Closed ejether closed 5 years ago

ejether commented 6 years ago

pentagon add datadog and pentagon add pentagon_datadog throw bad errors when the datadog pip module is installed in addition to the pentagon_datadog module

sudermanjr commented 6 years ago

Here is the error message:


[sudermanjr default production-1]⌂107%  [pw] master(+16/-3) 130± pentagon add datadog
Traceback (most recent call last):
  File "/Users/asuderma/.pentagon/pw/bin/pentagon", line 11, in <module>
    load_entry_point('pentagon', 'console_scripts', 'pentagon')()
  File "/Users/asuderma/.pentagon/pw/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/asuderma/.pentagon/pw/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/asuderma/.pentagon/pw/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/asuderma/.pentagon/pw/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/asuderma/.pentagon/pw/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/asuderma/.pentagon/pw/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/asuderma/.pentagon/pw/src/pentagon-datadog/pentagon/cli.py", line 153, in add
    _run('add', component_path, additional_args, kwargs)
  File "/Users/asuderma/.pentagon/pw/src/pentagon-datadog/pentagon/cli.py", line 200, in _run
    component_class = get_component_class(component_path)
  File "/Users/asuderma/.pentagon/pw/src/pentagon-datadog/pentagon/cli.py", line 241, in get_component_class
    component_class = locate(class_path)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 1518, in locate
    nextmodule = safeimport(join(parts[:n+1], '.'), forceload)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pydoc.py", line 332, in safeimport
    raise ErrorDuringImport(sys.modules[path].__file__, info)
AttributeError: 'NoneType' object has no attribute '__file__'```
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.