Skip to content

Commit a60a176

Browse files
Merge pull request #56 from elenagerman/ssh-private-key
key-filename option was added to ssh
2 parents 82ae0f3 + cd1d6ab commit a60a176

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

ansible/rebuild_module.digest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
beba445971676e714868c715f59c07e0 -
1+
3cc90352c787fb2a66626b33f149e1f9 -

ansible/roles/openshift_client_python/library/openshift_client_python.py

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/openshift/base_verbs.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,7 @@ def node_ssh_client(apiobj_node_name_or_qname=None,
13521352
port=22,
13531353
username=None,
13541354
password=None,
1355+
key_filename=None,
13551356
auto_add_host=True,
13561357
connect_timeout=600,
13571358
through_client_host=True,
@@ -1365,6 +1366,7 @@ def node_ssh_client(apiobj_node_name_or_qname=None,
13651366
:param port: The ssh port
13661367
:param username: The username to use
13671368
:param password: The username's password
1369+
:param key_filename: The filename of optional private key and/or cert to try for authentication
13681370
:param auto_add_host: Whether to auto accept host certificates
13691371
:param connect_timeout: Connection timeout
13701372
:param through_client_host: If True, and client_host is being used, ssh will be initiated
@@ -1423,8 +1425,8 @@ def node_ssh_client(apiobj_node_name_or_qname=None,
14231425
password = cur_context().get_ssh_password()
14241426

14251427
ssh_client.connect(hostname=address, port=port, username=username,
1426-
password=password, timeout=connect_timeout,
1427-
sock=host_sock)
1428+
password=password, key_filename=key_filename,
1429+
timeout=connect_timeout, sock=host_sock)
14281430

14291431
# Enable agent fowarding
14301432
paramiko.agent.AgentRequestHandler(ssh_client.get_transport().open_session())
@@ -1439,6 +1441,7 @@ def node_ssh_await(apiobj_node_name_or_qname=None,
14391441
port=22,
14401442
username=None,
14411443
password=None,
1444+
key_filename=None,
14421445
auto_add_host=True,
14431446
through_client_host=True,
14441447
address_type_pref="ExternalDNS,ExternalIP,Hostname"):
@@ -1449,6 +1452,7 @@ def node_ssh_await(apiobj_node_name_or_qname=None,
14491452
:param port:
14501453
:param username:
14511454
:param password:
1455+
:param key_filename:
14521456
:param auto_add_host:
14531457
:param through_client_host:
14541458
:param address_type_pref:
@@ -1464,6 +1468,7 @@ def node_ssh_await(apiobj_node_name_or_qname=None,
14641468
port=port,
14651469
username=username,
14661470
password=password,
1471+
key_filename=key_filename,
14671472
auto_add_host=auto_add_host,
14681473
connect_timeout=25,
14691474
through_client_host=through_client_host,
@@ -1482,6 +1487,7 @@ def node_ssh_client_exec(apiobj_node_name_or_qname=None,
14821487
port=22,
14831488
username=None,
14841489
password=None,
1490+
key_filename=None,
14851491
auto_add_host=True,
14861492
connect_timeout=600,
14871493
through_client_host=True,
@@ -1497,6 +1503,7 @@ def node_ssh_client_exec(apiobj_node_name_or_qname=None,
14971503
:param port: The ssh port
14981504
:param username: The username to use
14991505
:param password: The username's password
1506+
:param key_filename: The filename of optional private key and/or cert to try for authentication
15001507
:param auto_add_host: Whether to auto accept host certificates
15011508
:param connect_timeout: Connection timeout
15021509
:param through_client_host: If True, and client_host is being used, ssh will be initiated
@@ -1511,6 +1518,7 @@ def node_ssh_client_exec(apiobj_node_name_or_qname=None,
15111518
port=port,
15121519
username=username,
15131520
password=password,
1521+
key_filename=key_filename,
15141522
auto_add_host=auto_add_host,
15151523
connect_timeout=connect_timeout,
15161524
through_client_host=through_client_host,

0 commit comments

Comments
 (0)