Skip to content

ShellScripHandler can't find the user name I specified in config file #16

Description

@EasonLiao

I wrote the username that should be used for ssh in config file like link

But ShellScriptHandler failed to use it because it's overwritten by the default parameter None in the constructor of ShellScriptHandler, see:

class ShellScriptHandler(BaseHandler):
    """ Shell Script Handler piggybacking on paramiko SSH"""

    def __init__(self, config_dir, hostname, logger_instance=None, port=22,
                 username=None, password=None, pkey=None, key_filename=None,
                 connect_timeout=None, allow_agent=True, look_for_keys=True,
                 compress=False, sock=None, verbose=False, debug=False,
                 command_timeout=None):

And I see the username and a bunch of other stuff are never passed to ShellScriptHandler, see link:

     handler = handler_class(self.config_dir, target,
                                self.logger_instance, verbose=True)

I added some ad-hoc fixes, I'm wondering what are appropriate ways to fix it? I'm happy to send a PR if you think this is something that needs to be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions