Skip to content

Commit

Permalink
Updated --deployer-list to match recent changes to --aux-list
Browse files Browse the repository at this point in the history
  • Loading branch information
hatRiot committed Jul 24, 2014
1 parent 9e5832c commit 159a0ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clusterd.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def prerun(options):

# then check if they want a listing of all deployers
if options.deploy_list:
deploy_utils.deploy_list()
deploy_utils.deploy_list(options.deploy_list)

if options.aux_list:
deploy_utils.auxiliary_list(options.aux_list)
Expand Down
3 changes: 2 additions & 1 deletion src/core/parse_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ def parse(arguments):
other = parser.add_argument_group("Other",
description='Miscellaneous flags')
other.add_argument("--deployer-list", help="List all available deployers",
action='store_true', dest='deploy_list', default=False)
action='store', dest='deploy_list', const='All', nargs='?',
metavar='platform')
other.add_argument("--aux-list", help="List all available exploits",
action='store', dest='aux_list', const='All', nargs='?',
metavar='platform')
Expand Down
9 changes: 7 additions & 2 deletions src/module/deploy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,18 @@ def bsh_deploy(arch, url, version, usr = None, pswd = None):
return res


def deploy_list():
def deploy_list(usr_platform = None):
""" Simple function for dumping all deployers for supported
platforms. This lists them in the format INTERFACE (name), where
name is used for matching.
"""

for platform in state.supported_platforms:

# check for a specified platform
if usr_platform != 'All' and usr_platform != platform:
continue

utility.Msg("Deployers for '%s'" % platform, LOG.UPDATE)
load = importlib.import_module('src.platform.%s.deployers' % platform)

Expand All @@ -153,7 +157,8 @@ def deploy_list():
try:
dp = deployer[0].find_module(deployer[1]).load_module(deployer[1])
if 'Any' in dp.versions: dp.versions.remove("Any") # used for FP only
utility.Msg("\t%s (%s [%s])" % (dp.title, deployer[1], '|'.join(dp.versions)))
utility.Msg("\t%s (%s [%s])" % (dp.title, deployer[1],
'|'.join(dp.versions)))

except Exception, e:
utility.Msg(e, LOG.DEBUG)
Expand Down

0 comments on commit 159a0ad

Please sign in to comment.