Skip to content

Refactor dispatch.py to avoid code re-use #24

@deadbits

Description

@deadbits

In current master branch, the code re-use in Dispatch.py is insane. This has cut the file size down in over half it's size, the workflow makes much more sense, avoid code re-use, and is much easier to follow overall

I've reworked this so all modules and machines go to a single submit function within Dispatch:

  • if no argument is required for module, run the module and return results
  • attempt to lookup artifact by session ID if provided, otherwise use artifact by name
  • verify artifact exists in DB
  • populate list of modules to run against artifact (singular if it isnt a machine, multiple if it is)
  • send these modules to execute via self.run against the artifact and return results
    • same as before; gets modular pointer via importlib, runs the module and returns results
  • call self.save_results
    • to update any existing documents and create any children documents
  • create nice JSON data for command line output and return this to omnibus-cli

Metadata

Metadata

Assignees

Labels

enhancementmoduleNew module or module enhancementtestingFeatures being tested before deployment

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions