# import imp
import json
+import string
import yaml
from random import choice as random_choice
from osm_ro import utils
datacenter_type = datacenter_descriptor.get("type", "openvim");
# module_info = None
+ for url_field in ('vim_url', 'vim_url_admin'):
+ # It is common that users copy and paste the URL from the VIM website
+ # (example OpenStack), therefore a common mistake is to include blank
+ # characters at the end of the URL. Let's remove it and just in case,
+ # lets remove trailing slash as well.
+ url = datacenter_descriptor.get(url_field)
+ if url:
+ datacenter_descriptor[url_field] = url.strip(string.whitespace + '/')
+
# load plugin
plugin_name = "rovim_" + datacenter_type
if plugin_name not in plugins:
"""
import json
import logging
+import string
from contextlib import contextmanager
from hashlib import sha1
from itertools import groupby
if "config" in wim_descriptor:
wim_descriptor["config"] = _serialize(wim_descriptor["config"])
+ url = wim_descriptor["wim_url"]
+ wim_descriptor["wim_url"] = url.strip(string.whitespace + "/")
+ # ^ This avoid the common problem caused by trailing spaces/slashes in
+ # the URL (due to CTRL+C/CTRL+V)
+
return self.db.new_row(
"wims", wim_descriptor, add_uuid=True, confidential_data=True)