Skip to content

Commit eaad096

Browse files
authored
Merge pull request #15 from cyberkov/fix-timeout
honor timeouts defined in the action
2 parents c5d01e3 + a43e536 commit eaad096

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## v2.1.0
4+
5+
* Timeouts defined in the action are now honored properly
6+
37
## v2.0.0
48

59
* Drop Python 2.7 support

actions/lib/action.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,14 @@ def run(self, **kwargs):
112112

113113
# parse parameters
114114
operation = self._get_del_arg('operation', kwargs_dict)
115+
timeout = self._get_del_arg('timeout', kwargs_dict)
115116
connection = self._resolve_connection(kwargs_dict)
116117
self._validate_connection(connection)
117118

118119
# connect to the server
119120
client = foreman.client.Foreman('https://{}/'.format(connection['server']),
120121
auth=(connection['username'], connection['password']),
121-
api_version=2)
122+
api_version=2, timeout=timeout)
122123

123124
# Performs a "deep" getattr() lookup so we can pass a string like
124125
# 'method1.method2.method3' without having to chain getattr()

pack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords:
88
- red
99
- hat
1010
- redhat
11-
version: 2.0.0
11+
version: 2.1.0
1212
author: Daniel Chamot
1313
email: daniel@nullkarma.com
1414
python_versions:

tests/test_action_lib_baseaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,5 +157,5 @@ def test_run(self, mock_foreman):
157157
self.assertEqual(result, op_result)
158158
mock_foreman.assert_called_with('https://{}/'.format(connection['server']),
159159
auth=(connection['username'], connection['password']),
160-
api_version=2)
160+
api_version=2, timeout=None)
161161
mock_func.assert_called_with(**op_args)

0 commit comments

Comments
 (0)