From 7d8a68d9e2e2d4aa70f99c419448f893b54cf08b Mon Sep 17 00:00:00 2001 From: "Jay Lau (Guangya Liu)" Date: Mon, 26 Jan 2015 21:54:49 -0500 Subject: [PATCH] Rename replicationcontroller_data to manifest Change-Id: Ib79f3b54557a19c818e19a815926aebf64cfb54a --- magnum/api/controllers/v1/replicationcontroller.py | 12 ++++++------ .../api/controllers/v1/test_replicationcontroller.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/magnum/api/controllers/v1/replicationcontroller.py b/magnum/api/controllers/v1/replicationcontroller.py index 565413ca9e..56c36abaa0 100644 --- a/magnum/api/controllers/v1/replicationcontroller.py +++ b/magnum/api/controllers/v1/replicationcontroller.py @@ -89,7 +89,7 @@ class ReplicationController(base.APIBase): manifest_url = wtypes.text """URL for ReplicationController file to create the RC""" - replicationcontroller_data = wtypes.text + manifest = wtypes.text """Data for service to create the ReplicationController""" links = wsme.wsattr([link.Link], readonly=True) @@ -159,9 +159,9 @@ class ReplicationController(base.APIBase): # Set replication controller name and labels from its manifest # TODO(jay-lau-513): retrieve replication controller name from # manifest_url - if (hasattr(self, "replicationcontroller_data") - and self.replicationcontroller_data is not None): - manifest = k8s_manifest.parse(self.replicationcontroller_data) + if (hasattr(self, "manifest") + and self.manifest is not None): + manifest = k8s_manifest.parse(self.manifest) self.name = manifest["id"] if "labels" in manifest: self.labels = manifest["labels"] @@ -330,8 +330,8 @@ class ReplicationControllersController(rest.RestController): # ignore manifest_url as it was used for create rc if field == 'manifest_url': continue - # ignore replicationcontroller_data as it was used for create rc - if field == 'replicationcontroller_data': + # ignore manifest as it was used for create rc + if field == 'manifest': continue try: patch_val = getattr(rc, field) diff --git a/magnum/tests/api/controllers/v1/test_replicationcontroller.py b/magnum/tests/api/controllers/v1/test_replicationcontroller.py index 3c9a765c18..3ff283c36b 100644 --- a/magnum/tests/api/controllers/v1/test_replicationcontroller.py +++ b/magnum/tests/api/controllers/v1/test_replicationcontroller.py @@ -32,7 +32,7 @@ class TestRCController(db_base.DbTestCase): params = ''' { "bay_uuid": "7ae81bb3-dec3-4289-8d6c-da80bd8001ae", - "replicationcontroller_data": "\ + "manifest": "\ {\ \\"id\\": \\"name_of_rc\\", \ \\"replicas\\": 3, \