projects
/
osm
/
osmclient.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Bug 1493 repo generation from osm-packages
[osm/osmclient.git]
/
osmclient
/
sol005
/
vim.py
diff --git
a/osmclient/sol005/vim.py
b/osmclient/sol005/vim.py
index
e5bf399
..
8b11c8d
100644
(file)
--- a/
osmclient/sol005/vim.py
+++ b/
osmclient/sol005/vim.py
@@
-72,16
+72,26
@@
class Vim(object):
def create(
self, name, vim_access, sdn_controller=None, sdn_port_mapping=None, wait=False
):
def create(
self, name, vim_access, sdn_controller=None, sdn_port_mapping=None, wait=False
):
+ vca_id = None
+
+ def get_vca_id(vca):
+ vca = self._client.vca.get(vca)
+ if vca is None:
+ raise NotFound("cannot find vca '{}'".format(vca))
+ return vca["_id"]
+
self._logger.debug("")
self._client.get_token()
self._logger.debug("")
self._client.get_token()
+ if "vca" in vim_access:
+ vca_id = get_vca_id(vim_access["vca"])
if "vim-type" not in vim_access:
# 'openstack' not in vim_access['vim-type']):
raise Exception("vim type not provided")
if "vim-type" not in vim_access:
# 'openstack' not in vim_access['vim-type']):
raise Exception("vim type not provided")
-
vim_account = {}
vim_account["name"] = name
vim_account = self.update_vim_account_dict(vim_account, vim_access)
vim_account = {}
vim_account["name"] = name
vim_account = self.update_vim_account_dict(vim_account, vim_access)
-
+ if vca_id:
+ vim_account["vca"] = vca_id
vim_config = {}
if "config" in vim_access and vim_access["config"] is not None:
vim_config = yaml.safe_load(vim_access["config"])
vim_config = {}
if "config" in vim_access and vim_access["config"] is not None:
vim_config = yaml.safe_load(vim_access["config"])