Add support for Node tainted field

Add tainted field for Senlin nodes

Depends-On: https://review.opendev.org/#/c/689606/
Change-Id: Iac034b7d8afe22a57de9f1fa9b37f3b2bf5fa0da
This commit is contained in:
Duc Truong 2019-10-23 22:20:09 +00:00
parent 6fdb9cd28f
commit b9e06def39
2 changed files with 4 additions and 0 deletions

View File

@ -80,6 +80,8 @@ class Node(_async_resource.AsyncResource):
details = resource.Body('details', type=dict)
#: A map containing the dependency of nodes
dependents = resource.Body('dependents', type=dict)
#: Whether the node is tainted. *Type: bool*
tainted = resource.Body('tainted', type=bool)
def _action(self, session, body):
"""Procedure the invoke an action API.

View File

@ -34,6 +34,7 @@ FAKE = {
'created_at': '2015-10-10T12:46:36.000000',
'updated_at': '2016-10-10T12:46:36.000000',
'init_at': '2015-10-10T12:46:36.000000',
'tainted': True
}
@ -66,6 +67,7 @@ class TestNode(base.TestCase):
self.assertEqual(FAKE['created_at'], sot.created_at)
self.assertEqual(FAKE['updated_at'], sot.updated_at)
self.assertEqual(FAKE['dependents'], sot.dependents)
self.assertEqual(FAKE['tainted'], sot.tainted)
def test_check(self):
sot = node.Node(**FAKE)