From 44796b2daa653469acfa21d4c9b2bab09030aa5e Mon Sep 17 00:00:00 2001 From: jonnary Date: Thu, 15 Dec 2016 13:10:06 +0800 Subject: [PATCH] Add user_id in resource class Policy This patch supports user_id in resource classs Policy. Change-Id: If088bf2e606b6bd74e520ff11b9ad2e1d97f5773 Partial-Bug: #1650120 --- openstack/cluster/v1/policy.py | 2 ++ openstack/tests/unit/cluster/v1/test_policy.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/openstack/cluster/v1/policy.py b/openstack/cluster/v1/policy.py index a6f5a38e..7b2e67bd 100644 --- a/openstack/cluster/v1/policy.py +++ b/openstack/cluster/v1/policy.py @@ -39,6 +39,8 @@ class Policy(resource.Resource): type = resource.Body('type') #: The ID of the project this policy belongs to. project_id = resource.Body('project') + #: The ID of the user who created this policy. + user_id = resource.Body('user') #: The timestamp when the policy is created. created_at = resource.Body('created_at') #: The timestamp when the policy was last updated. diff --git a/openstack/tests/unit/cluster/v1/test_policy.py b/openstack/tests/unit/cluster/v1/test_policy.py index fa735d7a..3c2be204 100644 --- a/openstack/tests/unit/cluster/v1/test_policy.py +++ b/openstack/tests/unit/cluster/v1/test_policy.py @@ -32,6 +32,7 @@ FAKE = { } }, 'project': '42d9e9663331431f97b75e25136307ff', + 'user': '3747afc360b64702a53bdd64dc1b8976', 'type': 'senlin.policy.deletion-1.0', 'created_at': '2015-10-10T12:46:36.000000', 'updated_at': '2016-10-10T12:46:36.000000', @@ -62,6 +63,7 @@ class TestPolicy(testtools.TestCase): self.assertEqual(FAKE['name'], sot.name) self.assertEqual(FAKE['spec'], sot.spec) self.assertEqual(FAKE['project'], sot.project_id) + self.assertEqual(FAKE['user'], sot.user_id) self.assertEqual(FAKE['data'], sot.data) self.assertEqual(FAKE['created_at'], sot.created_at) self.assertEqual(FAKE['updated_at'], sot.updated_at)