diff --git a/tackerclient/tacker/v1_0/nfvo/vim_utils.py b/tackerclient/tacker/v1_0/nfvo/vim_utils.py index 43c2df84..b916dead 100644 --- a/tackerclient/tacker/v1_0/nfvo/vim_utils.py +++ b/tackerclient/tacker/v1_0/nfvo/vim_utils.py @@ -24,17 +24,15 @@ def args2body_vim(config_param, vim): :param vim: vim request object :return: vim body with args populated """ - vim['vim_project'] = {'id': config_param.pop('project_id', ''), - 'name': config_param.pop('project_name', ''), + vim['vim_project'] = {'name': config_param.pop('project_name', ''), 'project_domain_name': config_param.pop('project_domain_name', '')} - if not vim['vim_project']['id'] and not vim['vim_project']['name']: - raise exceptions.TackerClientException(message='Project Id or name ' + if not vim['vim_project']['name']: + raise exceptions.TackerClientException(message='Project name ' 'must be specified', status_code=404) vim['auth_cred'] = {'username': config_param.pop('username', ''), 'password': config_param.pop('password', ''), - 'user_id': config_param.pop('user_id', ''), 'user_domain_name': config_param.pop('user_domain_name', '')} diff --git a/tackerclient/tests/unit/vm/test_cli10_vim.py b/tackerclient/tests/unit/vm/test_cli10_vim.py index 590e839a..81c53f13 100644 --- a/tackerclient/tests/unit/vm/test_cli10_vim.py +++ b/tackerclient/tests/unit/vm/test_cli10_vim.py @@ -35,10 +35,10 @@ class CLITestV10VIMJSON(test_cli10.CLITestV10Base): plurals = {'vims': 'vim'} super(CLITestV10VIMJSON, self).setUp(plurals=plurals) self.vim_project = { - 'name': 'abc', 'id': '', + 'name': 'abc', 'project_domain_name': 'prj_domain_name'} - self.auth_cred = {'username': 'xyz', 'password': '12345', 'user_id': - '', 'user_domain_name': 'user_domain_name'} + self.auth_cred = {'username': 'xyz', 'password': '12345', + 'user_domain_name': 'user_domain_name'} self.auth_url = 'http://1.2.3.4:5000' def test_register_vim_all_params(self): diff --git a/tackerclient/tests/unit/vm/test_vim_utils.py b/tackerclient/tests/unit/vm/test_vim_utils.py index f2535894..50a53f68 100644 --- a/tackerclient/tests/unit/vm/test_vim_utils.py +++ b/tackerclient/tests/unit/vm/test_vim_utils.py @@ -24,20 +24,18 @@ from tackerclient.tacker.v1_0.nfvo import vim_utils class TestVIMUtils(testtools.TestCase): def test_args2body_vim(self): - config_param = {'project_id': sentinel.prj_id1, + config_param = {'project_name': sentinel.prj_name, 'username': sentinel.usrname1, 'password': sentinel.password1, 'project_domain_name': sentinel.prj_domain_name1, 'user_domain_name': sentinel.user_domain.name, } vim = {} auth_cred = config_param.copy() - auth_cred.pop('project_id') + auth_cred.pop('project_name') auth_cred.pop('project_domain_name') - auth_cred.update({'user_id': ''}) expected_vim = {'auth_cred': auth_cred, 'vim_project': - {'id': sentinel.prj_id1, - 'name': '', + {'name': sentinel.prj_name, 'project_domain_name': sentinel.prj_domain_name1}} vim_utils.args2body_vim(config_param.copy(), vim) self.assertEqual(expected_vim, vim)