Commit 6145f6ad authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

vmapi: Remove extra '/' from config_url

Use urlparse.urljoin create the config url in order to avoid extra '/'.
parent dabd6d1a
......@@ -35,6 +35,7 @@ from logging import getLogger
from django.utils import simplejson as json
from django.core.urlresolvers import reverse
from urlparse import urljoin
from synnefo.api.servers import server_created
from synnefo.vmapi import backend, get_key, get_uuid, settings
......@@ -49,10 +50,10 @@ def create_server_params(sender, created_vm_params, **kwargs):
log.info("Setting vmapi params with key %s for %s", key, sender)
backend.set(key, json_value)
config_url = urljoin(settings.BASE_URL, reverse("vmapi_server_params",
args=[uuid]))
# inject sender (vm) with its configuration url
setattr(sender, 'config_url', "%s%s" % (settings.BASE_URL,
reverse('vmapi_server_params',
args=[uuid])))
setattr(sender, 'config_url', config_url)
return uuid
server_created.connect(create_server_params)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment