Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
deadbits opened this issue Aug 28, 2018 · 0 comments
Open

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

deadbits opened this issue Aug 28, 2018 · 0 comments
Assignees
Labels
enhancement module New module or module enhancement testing Features being tested before deployment
Projects

Comments

@deadbits
Copy link
Contributor

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
@deadbits deadbits added enhancement module New module or module enhancement testing Features being tested before deployment labels Aug 28, 2018
@deadbits deadbits self-assigned this Aug 28, 2018
@deadbits deadbits added this to To do in Version 1.0 via automation Aug 28, 2018
@deadbits deadbits moved this from To do to Needs review in Version 1.0 Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement module New module or module enhancement testing Features being tested before deployment
Projects
Version 1.0
  
Testing
Development

No branches or pull requests

1 participant