Merge "Add API binding for the template_parameters action"

This commit is contained in:
Jenkins 2014-03-28 10:37:27 +00:00 committed by Gerrit Code Review
commit 9eb1f3e1f2
2 changed files with 15 additions and 0 deletions

View File

@ -76,3 +76,10 @@ class OvercloudManagerTest(tutils.TestCase):
self.assertEqual(self.om.delete(42), None)
self.om._delete.assert_called_with('/v1/overclouds/42')
def test_template_parameters(self):
"""Test getting the template parameters via GET."""
self.om._get = mock.Mock(return_value={})
self.assertEqual(self.om.template_parameters(), {})
self.om._get.assert_called_with('/v1/overclouds/template_parameters')

View File

@ -93,3 +93,11 @@ class OvercloudManager(base.Manager):
:rtype: None
"""
return self._delete(self._single_path(overcloud_id))
def template_parameters(self):
"""Get the template parameters from the Tuskar API.
:return: Dictionary containing template parameters
:rtype: dict
"""
return self._get("{0}/template_parameters".format(self._path()))