From f5474258bd5878f18542f330072842dfce5339ee Mon Sep 17 00:00:00 2001 From: Chris Hambridge Date: Tue, 15 Aug 2017 14:04:46 -0400 Subject: [PATCH] collect ssh_port from options passed in after validation. Closes #185. --- rho/profileaddcommand.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rho/profileaddcommand.py b/rho/profileaddcommand.py index cfca45e..473a58b 100644 --- a/rho/profileaddcommand.py +++ b/rho/profileaddcommand.py @@ -110,13 +110,15 @@ def _validate_options(self): print(str(port_error)) self.parser.print_help() sys.exit(1) + else: + self.options.sshport = 22 # pylint: disable=too-many-locals def _do_command(self): vault = get_vault(self.options.vaultfile) hosts_list = self.options.hosts profiles_list = [] - ssh_port = 22 + ssh_port = self.options.sshport if os.path.isfile(utilities.PROFILES_PATH): profiles_list = vault.load_as_json(utilities.PROFILES_PATH)