Add the new degraded field to Leases
Partially Implements: blueprint resource-monitoring Depends-On: Id98c8d956f36ce5ae9fcecef9e1d181a208d3e3a Change-Id: I4d373b6890e12cebefd3e320eb69c7fb3f442ff3
This commit is contained in:
parent
0c286007c3
commit
1b1f50f470
@ -33,7 +33,8 @@ class Lease(base.APIDictWrapper):
|
||||
) = ('IN_PROGRESS', 'FAILED', 'COMPLETE')
|
||||
|
||||
_attrs = ['id', 'name', 'start_date', 'end_date', 'user_id', 'project_id',
|
||||
'before_end_date', 'action', 'status', 'status_reason']
|
||||
'before_end_date', 'action', 'status', 'status_reason',
|
||||
'degraded']
|
||||
|
||||
def __init__(self, apiresource):
|
||||
super(Lease, self).__init__(apiresource)
|
||||
|
@ -87,6 +87,9 @@ class LeasesTable(tables.DataTable):
|
||||
action = tables.Column("action", verbose_name=_("Action"),)
|
||||
status = tables.Column("status", verbose_name=_("Status"),)
|
||||
status_reason = tables.Column("status_reason", verbose_name=_("Reason"),)
|
||||
degraded = tables.Column("degraded", verbose_name=_("Degraded"),
|
||||
filters=(django_filters.yesno,
|
||||
django_filters.capfirst),)
|
||||
|
||||
class Meta(object):
|
||||
name = "leases"
|
||||
|
@ -21,6 +21,8 @@
|
||||
<dd>{{ lease.status|default:"-" }}</dd>
|
||||
<dt>{% trans "Status Reason" %}</dt>
|
||||
<dd>{{ lease.status_reason|default:"-" }}</dd>
|
||||
<dt>{% trans "Degraded" %}</dt>
|
||||
<dd>{{ lease.degraded|yesno|capfirst }}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
|
@ -32,7 +32,9 @@ lease_sample1 = {
|
||||
'created_at': '2017-06-27 15:00:00',
|
||||
'updated_at': None,
|
||||
'id': '087bc740-6d2d-410b-9d47-c7b2b55a9d36',
|
||||
'resource_type': 'physical:host'
|
||||
'resource_type': 'physical:host',
|
||||
'missing_resources': False,
|
||||
'resources_changed': False
|
||||
}
|
||||
],
|
||||
'created_at': '2017-06-27 15:00:00',
|
||||
@ -71,7 +73,8 @@ lease_sample1 = {
|
||||
'project_id': 'aa45f56901ef45ee95e3d211097c0ea3',
|
||||
'status_reason': None,
|
||||
'start_date': '2017-06-27T18:00:00.000000',
|
||||
'trust_id': 'b442a580b9504ababf305bf2b4c49512'
|
||||
'trust_id': 'b442a580b9504ababf305bf2b4c49512',
|
||||
'degraded': False
|
||||
}
|
||||
|
||||
lease_sample2 = {
|
||||
@ -91,7 +94,9 @@ lease_sample2 = {
|
||||
'created_at': '2017-06-27 15:00:00',
|
||||
'updated_at': None,
|
||||
'id': '1b05370e-d92a-452d-80db-89842666b604',
|
||||
'resource_type': 'physical:host'
|
||||
'resource_type': 'physical:host',
|
||||
'missing_resources': False,
|
||||
'resources_changed': False
|
||||
}
|
||||
],
|
||||
'created_at': '2017-06-27 15:00:00',
|
||||
@ -130,7 +135,8 @@ lease_sample2 = {
|
||||
'project_id': 'aa45f56901ef45ee95e3d211097c0ea3',
|
||||
'status_reason': None,
|
||||
'start_date': '2017-06-27T18:00:00.000000',
|
||||
'trust_id': 'b442a580b9504ababf305bf2b4c49512'
|
||||
'trust_id': 'b442a580b9504ababf305bf2b4c49512',
|
||||
'degraded': False
|
||||
}
|
||||
|
||||
host_sample1 = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user