onelogin/onelogin-python-aws-assume-role

Where is the writer module?

Closed this issue · 5 comments

When I run the "onelogin-aws-assume-role" command, I get a complaint that the "writer" module doesn't exist. I can't find a module in Python called "writer" with "ConfigFileWriter" as an exportable function. I'm not very good at Python, so this might be a really dumb question. Can you tell me what this call is fetching when it calls "from writer import ConfigFileWriter" and how I can get it?

D'oh! I should have seen that. Any idea why it'd say it can't find the writer module when it runs?

I'm getting the same error:

$ docker run -it -v ~/.aws:/root/.aws awsaccess:latest onelogin-aws-assume-role
Traceback (most recent call last):
  File "/usr/local/bin/onelogin-aws-assume-role", line 11, in <module>
    load_entry_point('onelogin-aws-assume-role', 'console_scripts', 'onelogin-aws-assume-role')()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/src/aws_assume_role/aws_assume_role.py", line 17, in <module>
    from writer import ConfigFileWriter
ModuleNotFoundError: No module named 'writer'

I'm running into this issue as well. I've followed the instructions for both running on my host and via docker. Neither option works. They both run into this exact error.

I am able to run the program by running the following:

python src/onelogin/aws-assume-role/aws-assume-role.py

This can be resolved by changing the import to work properly:

from writer import ConfigFileWriter becomes from aws_assume_role.writer import ConfigFileWriter.

I'll open a PR now.