diff --git a/tackerclient/tacker/v1_0/nfvo/vim.py b/tackerclient/tacker/v1_0/nfvo/vim.py index 5355c3cb..17d56fe8 100644 --- a/tackerclient/tacker/v1_0/nfvo/vim.py +++ b/tackerclient/tacker/v1_0/nfvo/vim.py @@ -28,8 +28,9 @@ class ListVIM(tackerV10.ListCommand): """List VIMs that belong to a given tenant.""" resource = _VIM - list_columns = ['id', 'name', 'type', 'description', 'auth_url', - 'placement_attr', 'auth_cred'] + + list_columns = ['id', 'tenant_id', 'name', 'type', 'description', + 'auth_url', 'placement_attr', 'auth_cred'] class ShowVIM(tackerV10.ShowCommand): @@ -73,6 +74,7 @@ class CreateVIM(tackerV10.CreateCommand): 'specified', status_code=404) vim_obj['auth_url'] = utils.validate_url(auth_url).geturl() + vim_obj['type'] = config_param.pop('type', 'openstack') vim_utils.args2body_vim(config_param, vim_obj) tackerV10.update_dict(parsed_args, body[self.resource], ['tenant_id', 'name', 'description']) @@ -103,6 +105,10 @@ class UpdateVIM(tackerV10.UpdateCommand): if parsed_args.config: parsed_args.config = parsed_args.config.decode('unicode_escape') config_param = yaml.load(parsed_args.config) + if 'auth_url' in config_param: + raise exceptions.TackerClientException(message='Auth URL cannot ' + 'be updated', + status_code=404) vim_obj = body[self.resource] vim_utils.args2body_vim(config_param, vim_obj) tackerV10.update_dict(parsed_args, body[self.resource], ['tenant_id']) diff --git a/tackerclient/tacker/v1_0/nfvo/vim_utils.py b/tackerclient/tacker/v1_0/nfvo/vim_utils.py index ba596bdf..b06dd645 100644 --- a/tackerclient/tacker/v1_0/nfvo/vim_utils.py +++ b/tackerclient/tacker/v1_0/nfvo/vim_utils.py @@ -30,7 +30,6 @@ def args2body_vim(config_param, vim): raise exceptions.TackerClientException(message='Project Id or name ' 'must be specified', status_code=404) - vim['type'] = config_param.pop('type', 'openstack') vim['auth_cred'] = {'username': config_param.pop('username', ''), 'password': config_param.pop('password', ''), 'user_id': config_param.pop('user_id', '')} diff --git a/tackerclient/tacker/v1_0/vm/vnf.py b/tackerclient/tacker/v1_0/vm/vnf.py index 6220142b..276e97bb 100644 --- a/tackerclient/tacker/v1_0/vm/vnf.py +++ b/tackerclient/tacker/v1_0/vm/vnf.py @@ -97,7 +97,7 @@ class CreateVNF(tackerV10.CreateCommand): _id = tackerV10.find_resourceid_by_name_or_id(tacker_client, 'vim', parsed_args. - vim_id) + vim_name) parsed_args.vim_id = _id if parsed_args.vnfd_name: _id = tackerV10.find_resourceid_by_name_or_id(tacker_client, diff --git a/tackerclient/tests/unit/vm/test_cli10_vim.py b/tackerclient/tests/unit/vm/test_cli10_vim.py index 9a342cd7..987bc2e6 100644 --- a/tackerclient/tests/unit/vm/test_cli10_vim.py +++ b/tackerclient/tests/unit/vm/test_cli10_vim.py @@ -95,8 +95,8 @@ class CLITestV10VIMJSON(test_cli10.CLITestV10Base): my_id = 'my-id' key = 'config' value = str(update_config) - extra_fields = {'type': 'openstack', 'vim_project': - self.vim_project, 'auth_cred': self.auth_cred} + extra_fields = {'vim_project': self.vim_project, 'auth_cred': + self.auth_cred} self._test_update_resource(self._RESOURCE, cmd, my_id, [my_id, '--%s' % key, value],