lyft / cartography

Cartography is a Python tool that consolidates infrastructure assets and the relationships between them in an intuitive graph view powered by a Neo4j database.

Home Page:https://lyft.github.io/cartography/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: 'Namespace' object has no attribute 'duo_api_key'

jychp opened this issue · comments

Description:

Error when launching cartography without configuring (or disabling) duo intel module.

AttributeError: 'Namespace' object has no attribute 'duo_api_key'

To Reproduce:

Launch cartography without duo config parameter and without specific module

Logs:

ERROR:cartography.sync:Unhandled exception during sync stage 'duo'
Traceback (most recent call last):
  File "/home/jeremy/Repos/cartography/cartography/sync.py", line 111, in run
    stage_func(neo4j_session, config)
  File "/home/jeremy/Repos/cartography/cartography/util.py", line 165, in timed
    return method(*args, **kwargs)
  File "/home/jeremy/Repos/cartography/cartography/intel/duo/__init__.py", line 58, in start_duo_ingestion
    config.duo_api_key,
AttributeError: 'Namespace' object has no attribute 'duo_api_key'
Traceback (most recent call last):
  File "/home/jeremy/.local/share/virtualenvs/cartography-ra6kuGgL/bin/cartography", line 33, in <module>
    sys.exit(load_entry_point('cartography', 'console_scripts', 'cartography')())
  File "/home/jeremy/Repos/cartography/cartography/cli.py", line 705, in main
    sys.exit(CLI(prog='cartography').main(argv))
  File "/home/jeremy/Repos/cartography/cartography/cli.py", line 686, in main
    return cartography.sync.run_with_config(self.sync, config)
  File "/home/jeremy/Repos/cartography/cartography/sync.py", line 189, in run_with_config
    return sync.run(neo4j_driver, config)
  File "/home/jeremy/Repos/cartography/cartography/sync.py", line 111, in run
    stage_func(neo4j_session, config)
  File "/home/jeremy/Repos/cartography/cartography/util.py", line 165, in timed
    return method(*args, **kwargs)
  File "/home/jeremy/Repos/cartography/cartography/intel/duo/__init__.py", line 58, in start_duo_ingestion
    config.duo_api_key,
AttributeError: 'Namespace' object has no attribute 'duo_api_key'

Please complete the following information::

commented

Hi, is it possible to disable the duo module? If yes, do you know how? Thanks.

@Mehyar-ALS you can use selected-modules argument to run only a sub set of modules.
It will solve your issue and greatly increase execution speed.

Ex: --selected-modules gsuite,github

commented

That was a very quick replay! Thanks

Marking as fixed by #1190, thanks @resilience-jychp !