mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Fix incorrect (changed: True) frequent in OCP task logs
This commit is contained in:
committed by
Shane McDonald
parent
cab8c690d2
commit
a2acbe9fe6
@@ -36,7 +36,7 @@ class RegisterQueue:
|
|||||||
ig.policy_instance_minimum = self.instance_min
|
ig.policy_instance_minimum = self.instance_min
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
if self.is_container_group:
|
if self.is_container_group and (ig.is_container_group != self.is_container_group):
|
||||||
ig.is_container_group = self.is_container_group
|
ig.is_container_group = self.is_container_group
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
|
|||||||
26
awx/main/tests/functional/commands/test_register_queue.py
Normal file
26
awx/main/tests/functional/commands/test_register_queue.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
from io import StringIO
|
||||||
|
from contextlib import redirect_stdout
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from awx.main.management.commands.register_queue import RegisterQueue
|
||||||
|
from awx.main.models.ha import InstanceGroup
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.django_db
|
||||||
|
def test_openshift_idempotence():
|
||||||
|
def perform_register():
|
||||||
|
with StringIO() as buffer:
|
||||||
|
with redirect_stdout(buffer):
|
||||||
|
RegisterQueue('default', 100, 0, [], is_container_group=True).register()
|
||||||
|
return buffer.getvalue()
|
||||||
|
|
||||||
|
assert '(changed: True)' in perform_register()
|
||||||
|
assert '(changed: True)' not in perform_register()
|
||||||
|
assert '(changed: True)' not in perform_register()
|
||||||
|
|
||||||
|
ig = InstanceGroup.objects.get(name='default')
|
||||||
|
assert ig.policy_instance_percentage == 100
|
||||||
|
assert ig.policy_instance_minimum == 0
|
||||||
|
assert ig.policy_instance_list == []
|
||||||
|
assert ig.is_container_group is True
|
||||||
Reference in New Issue
Block a user