Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/modules/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ def main():
)
except CheckDoneTimeoutException as e:
result, error = e.result, e.error
module.warn('Timeout while waiting for firewall to be configured.')
module.fail_json(msg='Timeout while waiting for firewall to be configured.')

full_after = result['firewall']
if not full_after.get('rules'):
Expand Down
13 changes: 2 additions & 11 deletions tests/unit/plugins/modules/test_firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

import pytest

from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import (
extract_warnings_texts,
)
from ansible_collections.community.internal_test_tools.tests.unit.utils.fetch_url_module_framework import (
FetchUrlCall,
BaseTestModule,
Expand Down Expand Up @@ -866,7 +863,7 @@ def test_wait_update(self, mocker):

def test_wait_update_timeout(self, mocker):
mocker.patch('time.sleep', lambda duration: None)
result = self.run_module_success(mocker, firewall, {
result = self.run_module_failed(mocker, firewall, {
'hetzner_user': '',
'hetzner_password': '',
'server_ip': '1.2.3.4',
Expand Down Expand Up @@ -923,13 +920,7 @@ def test_wait_update_timeout(self, mocker):
})
.expect_url('{0}/firewall/1.2.3.4'.format(BASE_URL)),
])
assert result['changed'] is True
assert result['diff']['before']['status'] == 'disabled'
assert result['diff']['after']['status'] == 'active'
assert result['firewall']['status'] == 'in process'
assert result['firewall']['server_ip'] == '1.2.3.4'
assert result['firewall']['server_number'] == 1
assert 'Timeout while waiting for firewall to be configured.' in extract_warnings_texts(result)
assert result['msg'] == 'Timeout while waiting for firewall to be configured.'

def test_nowait_update(self, mocker):
result = self.run_module_success(mocker, firewall, {
Expand Down