Skip to content

Commit c9d3849

Browse files
committed
fix(k8sworker): ssh passphrase
Signed-off-by: Chris Snow <chsnow123@gmail.com>
1 parent 5797b69 commit c9d3849

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

hpecp/cli/k8sworker.py

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def create_with_ssh_key(
5555
ip=None,
5656
ssh_key=None,
5757
ssh_key_file=None,
58+
ssh_passphrase=None,
5859
tags=None,
5960
ephemeral_disks=None,
6061
persistent_disks=None,
@@ -72,6 +73,8 @@ def create_with_ssh_key(
7273
file may also be provided, by default None.
7374
ssh_key_file : str, optional
7475
The SSH key file path, by default None
76+
ssh_passphrase: str, optional
77+
The SSH passphrase
7578
tags : list, optional
7679
Tags to use, e.g. /api/v2/tag/1:foo,/api/v2/tag/1:bar,
7780
by default None
@@ -136,6 +139,7 @@ def create_with_ssh_key(
136139
worker_id = base.get_client().k8s_worker.create_with_ssh_key(
137140
ip=ip,
138141
ssh_key_data=ssh_key,
142+
ssh_passphrase=ssh_passphrase,
139143
tags=tags_parsed,
140144
)
141145

hpecp/k8s_worker.py

+5
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ def create_with_ssh_key(self, ip, ssh_key_data, tags=[]):
117117
communication.
118118
ssh_key_data: str
119119
The ssh key data as a string.
120+
ssh_passphrase: str
121+
The ssh passphrase
120122
tags: list
121123
Tags to use, e.g. "{ 'tag1': 'foo', 'tag2', 'bar' }".
122124
@@ -142,6 +144,9 @@ def create_with_ssh_key(self, ip, ssh_key_data, tags=[]):
142144
"tags": tags,
143145
}
144146

147+
if ssh_passphrase is not None:
148+
data['credentials']['ssh_passphrase'] = ssh_passphrase
149+
145150
response = self.client._request(
146151
url="/api/v2/worker/k8shost/",
147152
http_method="post",

0 commit comments

Comments
 (0)