Fix Cluster Template name
When Cluster Template is being uploaded, name is passed through URL. Fixes bug: #1206252 Change-Id: I19d7b9fe657cbf801548d4472c6735bd90b8a42a
This commit is contained in:
parent
ebbc524ff2
commit
80995526b6
|
@ -152,12 +152,12 @@ def plugins_get_version(plugin_name, version):
|
|||
return u.render(api.get_plugin(plugin_name, version).wrapped_dict)
|
||||
|
||||
|
||||
@rest.post_file('/plugins/<plugin_name>/<version>/convert-config')
|
||||
@rest.post_file('/plugins/<plugin_name>/<version>/convert-config/<name>')
|
||||
@v.check_exists(api.get_plugin, plugin_name='plugin_name', version='version')
|
||||
@v.validate(v_p.CONVERT_TO_TEMPLATE_SCHEMA, v_p.check_convert_to_template)
|
||||
def plugins_convert_to_cluster_template(plugin_name, version, data):
|
||||
def plugins_convert_to_cluster_template(plugin_name, version, name, data):
|
||||
return u.render(
|
||||
api.convert_to_cluster_template(plugin_name, version, data))
|
||||
api.convert_to_cluster_template(plugin_name, version, name, data))
|
||||
|
||||
|
||||
## Image Registry ops
|
||||
|
|
|
@ -13,12 +13,13 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import urllib
|
||||
|
||||
from savanna import context
|
||||
from savanna.db import models as m
|
||||
from savanna.db import storage as s
|
||||
from savanna.openstack.common import excutils
|
||||
from savanna.openstack.common import log as logging
|
||||
from savanna.openstack.common import uuidutils
|
||||
from savanna.plugins import base as plugin_base
|
||||
from savanna.plugins import provisioning
|
||||
from savanna.service import instances as i
|
||||
|
@ -188,10 +189,10 @@ def get_plugin(plugin_name, version=None):
|
|||
return res
|
||||
|
||||
|
||||
def convert_to_cluster_template(plugin_name, version, config_file):
|
||||
def convert_to_cluster_template(plugin_name, version, name, config_file):
|
||||
plugin = plugin_base.PLUGINS.get_plugin(plugin_name)
|
||||
tenant_id = context.current().tenant_id
|
||||
name = uuidutils.generate_uuid()
|
||||
name = urllib.unquote(name)
|
||||
ct = m.ClusterTemplate(name, tenant_id, plugin_name, version)
|
||||
plugin.convert(ct, config_file)
|
||||
|
||||
|
|
Loading…
Reference in New Issue