diff options
Diffstat (limited to 'savannaclient/api/plugins.py')
-rw-r--r-- | savannaclient/api/plugins.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/savannaclient/api/plugins.py b/savannaclient/api/plugins.py index b9c93ef..5f27f8d 100644 --- a/savannaclient/api/plugins.py +++ b/savannaclient/api/plugins.py @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import urllib + from savannaclient.api import base @@ -36,10 +38,15 @@ class PluginManager(base.ResourceManager): 'plugin') def convert_to_cluster_template(self, plugin_name, hadoop_version, - filecontent): - resp = self.api.client.post('/plugins/%s/%s/convert-config' % - (plugin_name, hadoop_version), filecontent) + template_name, filecontent): + resp = self.api.client.post('/plugins/%s/%s/convert-config/%s' % + (plugin_name, + hadoop_version, + urllib.quote(template_name)), + filecontent) if resp.status_code != 202: raise RuntimeError('Failed to upload template file for plugin "%s"' ' and version "%s"' % (plugin_name, hadoop_version)) + else: + return base.get_json(resp)['cluster_template'] |