@command('<STR_LIT:list>')<EOL>def list(config=None):
storm_ = get_storm_instance(config)<EOL>try:<EOL><INDENT>result = colored('<STR_LIT>', '<STR_LIT>', attrs=["<STR_LIT>", ]) + "<STR_LIT>"<EOL>result_stack = "<STR_LIT>"<EOL>for host in storm_.list_entries(True):<EOL><INDENT>if host.get("<STR_LIT:type>") == '<STR_LIT>':<EOL><INDENT>if not host.get("<STR_LIT:host>") == "<STR_LIT:*>":<EOL><INDENT>result += "<STR_LIT>".format(<EOL>colored(host["<STR_LIT:host>"], '<STR_LIT>', attrs=["<STR_LIT>", ]),<EOL>host.get("<STR_LIT>").get(<EOL>"<STR_LIT:user>", get_default("<STR_LIT:user>", storm_.defaults)<EOL>),<EOL>host.get("<STR_LIT>").get(<EOL>"<STR_LIT>", "<STR_LIT>"<EOL>),<EOL>host.get("<STR_LIT>").get(<EOL>"<STR_LIT:port>", get_default("<STR_LIT:port>", storm_.defaults)<EOL>)<EOL>)<EOL>extra = False<EOL>for key, value in six.iteritems(host.get("<STR_LIT>")):<EOL><INDENT>if not key in ["<STR_LIT:user>", "<STR_LIT>", "<STR_LIT:port>"]:<EOL><INDENT>if not extra:<EOL><INDENT>custom_options = colored(<EOL>'<STR_LIT>', '<STR_LIT>'<EOL>)<EOL>result += "<STR_LIT>".format(custom_options)<EOL><DEDENT>extra = True<EOL>if isinstance(value, collections.Sequence):<EOL><INDENT>if isinstance(value, builtins.list):<EOL><INDENT>value = "<STR_LIT:U+002C>".join(value)<EOL><DEDENT><DEDENT>result += "<STR_LIT>".format(key, value)<EOL><DEDENT><DEDENT>if extra:<EOL><INDENT>result = result[<NUM_LIT:0>:-<NUM_LIT:1>]<EOL><DEDENT>result += "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>result_stack = colored(<EOL>"<STR_LIT>", "<STR_LIT>", attrs=["<STR_LIT>",]<EOL>)<EOL>for key, value in six.iteritems(host.get("<STR_LIT>")):<EOL><INDENT>if isinstance(value, type([])):<EOL><INDENT>result_stack += "<STR_LIT>".format(<EOL>colored(key, "<STR_LIT>")<EOL>)<EOL>result_stack += '<STR_LIT:U+002CU+0020>'.join(value)<EOL>result_stack += "<STR_LIT:\n>"<EOL><DEDENT>else:<EOL><INDENT>result_stack += "<STR_LIT>".format(<EOL>colored(key, "<STR_LIT>"),<EOL>value,<EOL>)<EOL><DEDENT><DEDENT>result_stack = result_stack[<NUM_LIT:0>:-<NUM_LIT:1>] + "<STR_LIT:\n>"<EOL><DEDENT><DEDENT><DEDENT>result += result_stack<EOL>print(get_formatted_message(result, "<STR_LIT>"))<EOL><DEDENT>except Exception as error:<EOL><INDENT>print(get_formatted_message(str(error), '<STR_LIT:error>'), file=sys.stderr)<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>
Lists all hosts from ssh config.