Fix Cluster Template name

When Cluster Template is being uploaded, name is passed through URL.

Fixes bug: #1206252

Change-Id: I7ec816766a183eb760e456d2e3efdd5a116ba50b
This commit is contained in:
Nikita Konovalov 2013-09-17 13:11:23 +04:00
parent 0e192e541d
commit 2d2a2673c8
2 changed files with 9 additions and 3 deletions

View File

@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import urllib
from savannadashboard.api import base
@ -42,9 +44,12 @@ 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"' %

View File

@ -47,6 +47,7 @@ class UploadFileForm(forms.SelfHandlingForm,
savanna = savannaclient.Client(request)
savanna.plugins.convert_to_cluster_template(plugin_name,
hadoop_version,
data['template_name'],
filecontent)
return True
except api_base.APIException as e: