diff --git a/tackerclient/client.py b/tackerclient/client.py index 0f615e16..0b5863e8 100644 --- a/tackerclient/client.py +++ b/tackerclient/client.py @@ -56,7 +56,7 @@ class HTTPClient(object): endpoint_url=None, insecure=False, endpoint_type='publicURL', auth_strategy='keystone', ca_cert=None, log_credentials=False, - service_type='servicevm', + service_type='nfv-orchestration', **kwargs): self.username = username @@ -256,7 +256,7 @@ class HTTPClient(object): body = json.loads(body) for endpoint in body.get('endpoints', []): - if (endpoint['type'] == 'servicevm' and + if (endpoint['type'] == 'nfv-orchestration' and endpoint.get('region') == self.region_name): if self.endpoint_type not in endpoint: raise exceptions.EndpointTypeNotFound( @@ -359,7 +359,7 @@ def construct_http_client(username=None, log_credentials=None, auth_strategy='keystone', ca_cert=None, - service_type='servicevm', + service_type='nfv-orchestration', session=None, **kwargs): diff --git a/tackerclient/shell.py b/tackerclient/shell.py index ce1feb96..8198111f 100644 --- a/tackerclient/shell.py +++ b/tackerclient/shell.py @@ -249,8 +249,10 @@ class TackerShell(app.App): parser.add_argument( '--os-service-type', metavar='', - default=env('OS_SERVICEVM_SERVICE_TYPE', default='servicevm'), - help=_('Defaults to env[OS_SERVICEVM_SERVICE_TYPE] or servicevm.')) + default=env('OS_TACKER_SERVICE_TYPE', + default='nfv-orchestration'), + help=_('Defaults to env[OS_TACKER_SERVICE_TYPE] or \ + nfv-orchestration.')) parser.add_argument( '--os-endpoint-type', metavar='', @@ -261,7 +263,8 @@ class TackerShell(app.App): # backward compatibility. parser.add_argument( '--service-type', metavar='', - default=env('OS_SERVICEVM_SERVICE_TYPE', default='servicevm'), + default=env('OS_TACKER_SERVICE_TYPE', + default='nfv-orchestration'), help=_('DEPRECATED! Use --os-service-type.')) # FIXME(bklei): --endpoint-type is deprecated but kept in for @@ -672,7 +675,8 @@ class TackerShell(app.App): super(TackerShell, self).initialize_app(argv) - self.api_version = {'servicevm': self.api_version} + self.api_version = {'nfv-orchestration': + self.api_version} # If the user is not asking for help, make sure they # have given us auth. diff --git a/tackerclient/tacker/client.py b/tackerclient/tacker/client.py index 1b497666..01c80ebc 100644 --- a/tackerclient/tacker/client.py +++ b/tackerclient/tacker/client.py @@ -19,7 +19,7 @@ from tackerclient.common import utils from tackerclient.openstack.common.gettextutils import _ -API_NAME = 'servicevm' +API_NAME = 'nfv-orchestration' API_VERSIONS = { '1.0': 'tackerclient.v1_0.client.Client', } diff --git a/tackerclient/tacker/v1_0/__init__.py b/tackerclient/tacker/v1_0/__init__.py index 3ef2594e..5b74ade9 100644 --- a/tackerclient/tacker/v1_0/__init__.py +++ b/tackerclient/tacker/v1_0/__init__.py @@ -353,7 +353,7 @@ class TackerCommandMeta(abc.ABCMeta): @six.add_metaclass(TackerCommandMeta) class TackerCommand(command.OpenStackCommand): - api = 'servicevm' + api = 'nfv-orchestration' values_specs = [] json_indent = None @@ -409,7 +409,7 @@ class CreateCommand(TackerCommand, show.ShowOne): """ - api = 'servicevm' + api = 'nfv-orchestration' resource = None log = None remove_output_fields = [] @@ -454,7 +454,7 @@ class CreateCommand(TackerCommand, show.ShowOne): class UpdateCommand(TackerCommand): """Update resource's information.""" - api = 'servicevm' + api = 'nfv-orchestration' resource = None log = None allow_names = True @@ -502,7 +502,7 @@ class DeleteCommand(TackerCommand): """ - api = 'servicevm' + api = 'nfv-orchestration' resource = None log = None allow_names = True @@ -542,7 +542,7 @@ class ListCommand(TackerCommand, lister.Lister): """ - api = 'servicevm' + api = 'nfv-orchestration' resource = None log = None _formatters = {} @@ -641,7 +641,7 @@ class ShowCommand(TackerCommand, show.ShowOne): """ - api = 'servicevm' + api = 'nfv-orchestration' resource = None log = None allow_names = True diff --git a/tackerclient/tests/unit/test_auth.py b/tackerclient/tests/unit/test_auth.py index 1c7da801..d41dee55 100644 --- a/tackerclient/tests/unit/test_auth.py +++ b/tackerclient/tests/unit/test_auth.py @@ -52,7 +52,7 @@ KS_TOKEN_RESULT = { 'internalURL': ENDPOINT_URL, 'publicURL': ENDPOINT_URL, 'region': REGION}], - 'type': 'servicevm', + 'type': 'nfv-orchestration', 'name': 'Tacker Service'} ] } @@ -60,7 +60,7 @@ KS_TOKEN_RESULT = { ENDPOINTS_RESULT = { 'endpoints': [{ - 'type': 'servicevm', + 'type': 'nfv-orchestration', 'name': 'Tacker Service', 'region': REGION, 'adminURL': ENDPOINT_URL, diff --git a/tackerclient/tests/unit/test_shell.py b/tackerclient/tests/unit/test_shell.py index 5c22f1bf..57150114 100644 --- a/tackerclient/tests/unit/test_shell.py +++ b/tackerclient/tests/unit/test_shell.py @@ -127,8 +127,10 @@ class ShellTest(testtools.TestCase): token='', url='', auth_url='http://127.0.0.1:5000/', tenant_name='test', tenant_id='tenant_id', username='test', user_id='', - password='test', region_name='', api_version={'servicevm': '1.0'}, - auth_strategy='keystone', service_type='servicevm', + password='test', region_name='', + api_version={'nfv-orchestration': '1.0'}, + auth_strategy='keystone', + service_type='nfv-orchestration', endpoint_type='publicURL', insecure=False, ca_cert=None, log_credentials=True) tacker_shell.run_subcommand(['device-template-list']) diff --git a/tackerclient/tests/unit/test_ssl.py b/tackerclient/tests/unit/test_ssl.py index 5c6945df..95c522b4 100644 --- a/tackerclient/tests/unit/test_ssl.py +++ b/tackerclient/tests/unit/test_ssl.py @@ -118,7 +118,7 @@ class TestSSL(testtools.TestCase): ) self.mox.ReplayAll() - version = {'servicevm': '1.0'} + version = {'nfv-orchestration': '1.0'} ClientManager(ca_cert=CA_CERT, api_version=version, url=END_URL,