Skip to content

Commit

Permalink
Bumped version and added private_commands ability
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdabbad00 committed Dec 24, 2018
1 parent 34c54da commit aa3e115
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ htmlcov/
account-data/
tmp/
trusted_ips.png
data/
data/
private_commands/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ python cloudmapper.py collect --account my_account
- `stats`: Show counts of resources for accounts. More details [here](https://summitroute.com/blog/2018/06/06/cloudmapper_stats/).
- `wot`: Show Web Of Trust. More details [here](https://summitroute.com/blog/2018/06/13/cloudmapper_wot/).

If you want to add your own private commands, you can create a `private_commands` directory and add them there.

Licenses
--------
Expand Down
13 changes: 7 additions & 6 deletions cloudmapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import importlib
import commands

__version__ = "2.2.0"
__version__ = "2.2.1"

def show_help(commands):
print("CloudMapper {}".format(__version__))
Expand All @@ -47,11 +47,12 @@ def main():
# Load commands
# TODO: This adds half a second to the start time. Is there a smarter way to do this?
commands = {}
commands_path = 'commands'
for importer, command_name, _ in pkgutil.iter_modules([commands_path]):
full_package_name = '%s.%s' % (commands_path, command_name)
module = importlib.import_module(full_package_name)
commands[command_name] = module
commands_paths = ['commands', 'private_commands']
for commands_path in commands_paths:
for importer, command_name, _ in pkgutil.iter_modules([commands_path]):
full_package_name = '%s.%s' % (commands_path, command_name)
module = importlib.import_module(full_package_name)
commands[command_name] = module

# Parse command
if len(sys.argv) <= 1:
Expand Down

0 comments on commit aa3e115

Please sign in to comment.