Skip to content

Commit

Permalink
Merge pull request #15 from cyberkov/fix-timeout
Browse files Browse the repository at this point in the history
honor timeouts defined in the action
  • Loading branch information
arm4b authored Feb 1, 2023
2 parents c5d01e3 + a43e536 commit eaad096
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## v2.1.0

* Timeouts defined in the action are now honored properly

## v2.0.0

* Drop Python 2.7 support
Expand Down
3 changes: 2 additions & 1 deletion actions/lib/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ def run(self, **kwargs):

# parse parameters
operation = self._get_del_arg('operation', kwargs_dict)
timeout = self._get_del_arg('timeout', kwargs_dict)
connection = self._resolve_connection(kwargs_dict)
self._validate_connection(connection)

# connect to the server
client = foreman.client.Foreman('https://{}/'.format(connection['server']),
auth=(connection['username'], connection['password']),
api_version=2)
api_version=2, timeout=timeout)

# Performs a "deep" getattr() lookup so we can pass a string like
# 'method1.method2.method3' without having to chain getattr()
Expand Down
2 changes: 1 addition & 1 deletion pack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ keywords:
- red
- hat
- redhat
version: 2.0.0
version: 2.1.0
author: Daniel Chamot
email: [email protected]
python_versions:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_action_lib_baseaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,5 @@ def test_run(self, mock_foreman):
self.assertEqual(result, op_result)
mock_foreman.assert_called_with('https://{}/'.format(connection['server']),
auth=(connection['username'], connection['password']),
api_version=2)
api_version=2, timeout=None)
mock_func.assert_called_with(**op_args)

0 comments on commit eaad096

Please sign in to comment.