Skip to content

Commit 2cdd145

Browse files
committed
add hpecp/k8s_worker doc check
Signed-off-by: Chris Snow <[email protected]>
1 parent e271526 commit 2cdd145

File tree

2 files changed

+37
-29
lines changed

2 files changed

+37
-29
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
install:
3737
- pip3 install flake8 flake8-docstrings flake8-per-file-ignores
3838
script:
39-
- flake8 --exclude hpecp/gateway.py,hpecp/logger.py,hpecp/lock.py,hpecp/k8s_cluster.py,hpecp/k8s_worker.py,hpecp/license.py,hpecp/user.py,hpecp/tenant.py,hpecp/role.py --docstring-convention numpy bin/ hpecp/
39+
- flake8 --exclude hpecp/gateway.py,hpecp/logger.py,hpecp/lock.py,hpecp/k8s_cluster.py,hpecp/license.py,hpecp/user.py,hpecp/tenant.py,hpecp/role.py --docstring-convention numpy bin/ hpecp/
4040
- stage: coverage_library
4141
name: "Code coverage LIBRARY (./hpecp)"
4242
python: 3.8

hpecp/k8s_worker.py

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,22 @@ def create_with_ssh_password(self, username, password):
144144
raise NotImplementedError()
145145

146146
def create_with_ssh_key(self, ip, ssh_key_data, tags=[]):
147-
"""Create a gateway instance using SSH key credentials to access the host
148-
149-
Args:
150-
ip: str
151-
The IP address of the proxy host. Used for internal
152-
communication.
153-
ssh_key_data: str
154-
The ssh key data as a string.
155-
tags: list
156-
Tags to use, e.g. "{ 'tag1': 'foo', 'tag2', 'bar' }".
157-
158-
Returns: Worker ID
147+
"""Create a gateway instance using SSH key credentials to access the host.
148+
149+
Parameters
150+
----------
151+
ip: str
152+
The IP address of the proxy host. Used for internal
153+
communication.
154+
ssh_key_data: str
155+
The ssh key data as a string.
156+
tags: list
157+
Tags to use, e.g. "{ 'tag1': 'foo', 'tag2', 'bar' }".
158+
159+
Returns
160+
-------
161+
string
162+
Worker ID
159163
"""
160164

161165
assert isinstance(
@@ -221,22 +225,26 @@ def delete(self, worker_id):
221225
def wait_for_status(self, worker_id, status=[], timeout_secs=1200):
222226
"""Wait for K8S worker status.
223227
224-
Args:
225-
worker_id: str
226-
The worker ID - format: '/api/v1/workers/[0-9]+'
227-
status: list[:py:class:`WorkerK8sStatus`]
228-
Status(es) to wait for. Use an empty array if you want to
229-
wait for a cluster's existence to cease.
230-
timeout_secs: int
231-
How long to wait for the status(es) before raising an
232-
exception.
233-
234-
Returns:
235-
bool: True if status was found before timeout, otherwise False
236-
237-
Raises:
238-
APIItemNotFoundException: if the item is not found and status is
239-
not empty
228+
Parameters
229+
----------
230+
worker_id: str
231+
The worker ID - format: '/api/v1/workers/[0-9]+'
232+
status: list[:py:class:`WorkerK8sStatus`]
233+
Status(es) to wait for. Use an empty array if you want to
234+
wait for a cluster's existence to cease.
235+
timeout_secs: int
236+
How long to wait for the status(es) before raising an
237+
exception.
238+
239+
Returns
240+
-------
241+
bool
242+
True if status was found before timeout, otherwise False
243+
244+
Raises
245+
------
246+
APIItemNotFoundException
247+
If the item is not found and status is not empty
240248
APIException: if a generic API exception occurred
241249
"""
242250
assert isinstance(

0 commit comments

Comments
 (0)