diff options
author | Peter Razumovsky <prazumovsky@mirantis.com> | 2015-04-20 14:52:59 +0300 |
---|---|---|
committer | Peter Razumovsky <prazumovsky@mirantis.com> | 2015-06-09 10:13:01 +0000 |
commit | 0f8f4d17bb987837c22de6b1f35df5064bf3c3ee (patch) | |
tree | b6bf7bc1ec3dd373c1b72c46202e7373c7e3cf9c /heatclient/v1/software_configs.py | |
parent | 296c8c2a73b936ce1cfc205f447ecc6a8183ebd3 (diff) | |
download | python-heatclient-0f8f4d17bb987837c22de6b1f35df5064bf3c3ee.tar.gz |
Move usage methods *_request to get/post/etc
HTTPClient has methods get/post/put and others, which
use json_request and raw_request, but other code uses
requests method instead of them.
Change-Id: I74ee34430afdae17f83ccdc877cc882f94651bce
Diffstat (limited to 'heatclient/v1/software_configs.py')
-rw-r--r-- | heatclient/v1/software_configs.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/heatclient/v1/software_configs.py b/heatclient/v1/software_configs.py index cf038db..dd3264d 100644 --- a/heatclient/v1/software_configs.py +++ b/heatclient/v1/software_configs.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +from heatclient.common import utils from heatclient.openstack.common.apiclient import base @@ -32,17 +33,16 @@ class SoftwareConfigManager(base.BaseManager): :param config_id: ID of the software config """ - resp, body = self.client.json_request( - 'GET', '/software_configs/%s' % config_id) - - return SoftwareConfig(self, body['software_config']) + resp = self.client.get('/software_configs/%s' % config_id) + body = utils.get_response_body(resp) + return SoftwareConfig(self, body.get('software_config')) def create(self, **kwargs): """Create a software config.""" - resp, body = self.client.json_request('POST', '/software_configs', - data=kwargs) - - return SoftwareConfig(self, body['software_config']) + resp = self.client.post('/software_configs', + data=kwargs) + body = utils.get_response_body(resp) + return SoftwareConfig(self, body.get('software_config')) def delete(self, config_id): """Delete a software config.""" |