API: Remove "changed" and "ignored" statuses
The principal consumers of the API relied on a combination of the status as well as the fields "changed" and "ignore_errors" to infer a "changed" or "ignored" status. This lead users to believe they could search for these statuses and it wouldn't work. The consumers should expose the status differently but that will be in another patch. Change-Id: Ib34a65179d07186ab2d2efc65ce14c46e2596df0
This commit is contained in:
20
ara/api/migrations/0006_remove_result_statuses.py
Normal file
20
ara/api/migrations/0006_remove_result_statuses.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 2.2.16 on 2020-09-06 18:51
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('api', '0005_unique_label_names'),
|
||||
]
|
||||
|
||||
# Previously, choices included "ignored" and "changed" but these were never used
|
||||
# See: https://github.com/ansible-community/ara/issues/150
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='result',
|
||||
name='status',
|
||||
field=models.CharField(choices=[('ok', 'ok'), ('failed', 'failed'), ('skipped', 'skipped'), ('unreachable', 'unreachable'), ('unknown', 'unknown')], default='unknown', max_length=25),
|
||||
),
|
||||
]
|
||||
@@ -244,20 +244,18 @@ class Result(Duration):
|
||||
FAILED = "failed"
|
||||
SKIPPED = "skipped"
|
||||
UNREACHABLE = "unreachable"
|
||||
# ARA specific statuses (derived or assumed)
|
||||
CHANGED = "changed"
|
||||
IGNORED = "ignored"
|
||||
# ARA specific status, it's the default when not specified
|
||||
UNKNOWN = "unknown"
|
||||
|
||||
# fmt:off
|
||||
STATUS = (
|
||||
(OK, "ok"),
|
||||
(FAILED, "failed"),
|
||||
(SKIPPED, "skipped"),
|
||||
(UNREACHABLE, "unreachable"),
|
||||
(CHANGED, "changed"),
|
||||
(IGNORED, "ignored"),
|
||||
(UNKNOWN, "unknown"),
|
||||
)
|
||||
# fmt:on
|
||||
|
||||
status = models.CharField(max_length=25, choices=STATUS, default=UNKNOWN)
|
||||
changed = models.BooleanField(default=False)
|
||||
|
||||
@@ -59,7 +59,7 @@ class ResultTestCase(APITestCase):
|
||||
serializer = serializers.ResultSerializer(
|
||||
data={
|
||||
"content": factories.RESULT_CONTENTS,
|
||||
"status": "changed",
|
||||
"status": "ok",
|
||||
"host": host.id,
|
||||
"task": task.id,
|
||||
"play": task.play.id,
|
||||
|
||||
Reference in New Issue
Block a user