__author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes"
__date__ = "$26-aug-2014 11:09:29$"
-__version__ = "0.5.46-r556"
-version_date = "Dec 2017"
+__version__ = "0.5.47-r557"
+version_date = "Jan 2018"
database_version = 27 # expected database schema version
class LoadConfigurationException(Exception):
pass
+
def load_configuration(configuration_file):
- default_tokens = {'http_port':9090,
- 'http_host':'localhost',
+ default_tokens = {'http_port': 9090,
+ 'http_host': 'localhost',
'http_console_proxy': True,
'http_console_host': None,
'log_level': 'DEBUG',
mydb.delete_row(FROM="datacenters_images", WHERE={"datacenter_vim_id": vim["id"], "vim_id":item["uuid"]})
elif item["what"]=="flavor":
vim.delete_flavor(item["uuid"])
- mydb.delete_row(FROM="datacenters_flavors", WHERE={"datacenter_id": vim["id"], "vim_id":item["uuid"]})
+ mydb.delete_row(FROM="datacenters_flavors", WHERE={"datacenter_vim_id": vim["id"], "vim_id":item["uuid"]})
elif item["what"]=="network":
vim.delete_network(item["uuid"])
elif item["what"]=="vm":
try:
myvnfd = vnfd_catalog.vnfd()
try:
- pybindJSONDecoder.load_ietf_json(vnf_descriptor, None, None, obj=myvnfd)
+ pybindJSONDecoder.load_ietf_json(vnf_descriptor, None, None, obj=myvnfd, path_helper=True)
except Exception as e:
raise NfvoException("Error. Invalid VNF descriptor format " + str(e), HTTP_Bad_Request)
db_vnfs = []
if not v: # skip already deleted
continue
try:
- if k.startswith("port:"):
- self.neutron.delete_port(k.strip("port:"))
+ k_item, _, k_id = k.partition(":")
+ if k_item == "port":
+ self.neutron.delete_port(k_id)
except Exception as e:
self.logger.error("Error deleting port: {}: {}".format(type(e).__name__, e))
if not v: # skip already deleted
continue
try:
- if k.startswith("volume:"):
- volume_id = k.strip("volume:")
- if self.cinder.volumes.get(volume_id).status != 'available':
+ k_item, _, k_id = k.partition(":")
+ if k_item == "volume":
+ if self.cinder.volumes.get(k_id).status != 'available':
keep_waiting = True
else:
- self.cinder.volumes.delete(volume_id)
+ self.cinder.volumes.delete(k_id)
except Exception as e:
self.logger.error("Error deleting volume: {}: {}".format(type(e).__name__, e))
if keep_waiting: