From 4a81b26b09daf9eee82b6a319f39134e5f3f5277 Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 11 Jul 2017 17:11:09 +0800 Subject: [PATCH] Unify style of 'domain' field The output of CLI need unify style of 'domain' filed. Change-Id: I556db6060af4ec480f50ae253eb652b5c42eec27 Partial-Bug: #1703545 --- openstack/cluster/v1/action.py | 2 ++ openstack/cluster/v1/node.py | 2 ++ openstack/cluster/v1/policy.py | 2 ++ openstack/cluster/v1/profile.py | 2 ++ openstack/tests/unit/cluster/v1/test_action.py | 2 ++ openstack/tests/unit/cluster/v1/test_node.py | 2 ++ openstack/tests/unit/cluster/v1/test_policy.py | 2 ++ openstack/tests/unit/cluster/v1/test_profile.py | 2 ++ 8 files changed, 16 insertions(+) diff --git a/openstack/cluster/v1/action.py b/openstack/cluster/v1/action.py index 255a34bc..a7db8aa9 100644 --- a/openstack/cluster/v1/action.py +++ b/openstack/cluster/v1/action.py @@ -44,6 +44,8 @@ class Action(resource.Resource): user_id = resource.Body('user') #: The ID of the project this profile belongs to. project_id = resource.Body('project') + #: The domain ID of the action. + domain_id = resource.Body('domain') #: Interval in seconds between two consecutive executions. interval = resource.Body('interval') #: The time the action was started. diff --git a/openstack/cluster/v1/node.py b/openstack/cluster/v1/node.py index 3b8bfa26..3c10dcc7 100644 --- a/openstack/cluster/v1/node.py +++ b/openstack/cluster/v1/node.py @@ -44,6 +44,8 @@ class Node(resource.Resource): cluster_id = resource.Body('cluster_id') #: The ID of the profile used by this node. profile_id = resource.Body('profile_id') + #: The domain ID of the node. + domain_id = resource.Body('domain') #: The ID of the user who created this node. user_id = resource.Body('user') #: The ID of the project this node belongs to. diff --git a/openstack/cluster/v1/policy.py b/openstack/cluster/v1/policy.py index 7b2e67bd..0137220b 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 domain ID of the policy. + domain_id = resource.Body('domain') #: The ID of the user who created this policy. user_id = resource.Body('user') #: The timestamp when the policy is created. diff --git a/openstack/cluster/v1/profile.py b/openstack/cluster/v1/profile.py index 7688e07c..711b302f 100644 --- a/openstack/cluster/v1/profile.py +++ b/openstack/cluster/v1/profile.py @@ -39,6 +39,8 @@ class Profile(resource.Resource): type = resource.Body('type') #: The ID of the project this profile belongs to. project_id = resource.Body('project') + #: The domain ID of the profile. + domain_id = resource.Body('domain') #: The ID of the user who created this profile. user_id = resource.Body('user') #: The spec of the profile. diff --git a/openstack/tests/unit/cluster/v1/test_action.py b/openstack/tests/unit/cluster/v1/test_action.py index 0cf72a38..01777952 100644 --- a/openstack/tests/unit/cluster/v1/test_action.py +++ b/openstack/tests/unit/cluster/v1/test_action.py @@ -27,6 +27,7 @@ FAKE = { 'owner': None, 'user': '3747afc360b64702a53bdd64dc1b8976', 'project': '42d9e9663331431f97b75e25136307ff', + 'domain': '204ccccd267b40aea871750116b5b184', 'interval': -1, 'start_time': 1453414055.48672, 'end_time': 1453414055.48672, @@ -66,6 +67,7 @@ class TestAction(testtools.TestCase): self.assertEqual(FAKE['owner'], sot.owner_id) self.assertEqual(FAKE['user'], sot.user_id) self.assertEqual(FAKE['project'], sot.project_id) + self.assertEqual(FAKE['domain'], sot.domain_id) self.assertEqual(FAKE['interval'], sot.interval) self.assertEqual(FAKE['start_time'], sot.start_at) self.assertEqual(FAKE['end_time'], sot.end_at) diff --git a/openstack/tests/unit/cluster/v1/test_node.py b/openstack/tests/unit/cluster/v1/test_node.py index aefffd03..cdf93896 100644 --- a/openstack/tests/unit/cluster/v1/test_node.py +++ b/openstack/tests/unit/cluster/v1/test_node.py @@ -25,6 +25,7 @@ FAKE = { 'metadata': {'key1': 'value1'}, 'name': FAKE_NAME, 'profile_id': 'myserver', + 'domain': '204ccccd267b40aea871750116b5b184', 'user': '3747afc360b64702a53bdd64dc1b8976', 'project': '42d9e9663331431f97b75e25136307ff', 'index': 1, @@ -57,6 +58,7 @@ class TestNode(testtools.TestCase): self.assertEqual(FAKE['cluster_id'], sot.cluster_id) self.assertEqual(FAKE['user'], sot.user_id) self.assertEqual(FAKE['project'], sot.project_id) + self.assertEqual(FAKE['domain'], sot.domain_id) self.assertEqual(FAKE['name'], sot.name) self.assertEqual(FAKE['index'], sot.index) self.assertEqual(FAKE['role'], sot.role) diff --git a/openstack/tests/unit/cluster/v1/test_policy.py b/openstack/tests/unit/cluster/v1/test_policy.py index 3c2be204..7a9b18fa 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', + 'domain': '204ccccd267b40aea871750116b5b184', 'user': '3747afc360b64702a53bdd64dc1b8976', 'type': 'senlin.policy.deletion-1.0', 'created_at': '2015-10-10T12:46:36.000000', @@ -63,6 +64,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['domain'], sot.domain_id) self.assertEqual(FAKE['user'], sot.user_id) self.assertEqual(FAKE['data'], sot.data) self.assertEqual(FAKE['created_at'], sot.created_at) diff --git a/openstack/tests/unit/cluster/v1/test_profile.py b/openstack/tests/unit/cluster/v1/test_profile.py index e371ed1b..7a65bf6f 100644 --- a/openstack/tests/unit/cluster/v1/test_profile.py +++ b/openstack/tests/unit/cluster/v1/test_profile.py @@ -33,6 +33,7 @@ FAKE = { } }, 'project': '42d9e9663331431f97b75e25136307ff', + 'domain': '204ccccd267b40aea871750116b5b184', 'user': '3747afc360b64702a53bdd64dc1b8976', 'type': 'os.nova.server', 'created_at': '2015-10-10T12:46:36.000000', @@ -65,6 +66,7 @@ class TestProfile(testtools.TestCase): self.assertEqual(FAKE['metadata'], sot.metadata) self.assertEqual(FAKE['spec'], sot.spec) self.assertEqual(FAKE['project'], sot.project_id) + self.assertEqual(FAKE['domain'], sot.domain_id) self.assertEqual(FAKE['user'], sot.user_id) self.assertEqual(FAKE['type'], sot.type) self.assertEqual(FAKE['created_at'], sot.created_at)