From 5903bc93385072f564e08ccbe5a965c9d2d1f9e7 Mon Sep 17 00:00:00 2001 From: "an.abdulrehman" Date: Thu, 17 Dec 2015 22:06:20 -0800 Subject: [PATCH] Renamed 'servicevm' in python-tackerclient After renaming the service 'servicevm' and 'advsvc' in install file, functional tests were failing. Now renamed to 'tacker' in all files of python-tackerclient repo so that functional test wouldn't fail. Change-Id: I919d77276af72586a20f50239166325adbf9fb11 Partial-Bug: #1524224 --- tackerclient/client.py | 6 +++--- tackerclient/shell.py | 12 ++++++++---- tackerclient/tacker/client.py | 2 +- tackerclient/tacker/v1_0/__init__.py | 12 ++++++------ tackerclient/tests/unit/test_auth.py | 4 ++-- tackerclient/tests/unit/test_shell.py | 6 ++++-- tackerclient/tests/unit/test_ssl.py | 2 +- 7 files changed, 25 insertions(+), 19 deletions(-) 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 6450cd40..df8d2e0d 100644 --- a/tackerclient/shell.py +++ b/tackerclient/shell.py @@ -248,8 +248,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='', @@ -260,7 +262,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 @@ -669,7 +672,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 9d48ef37..d040a06a 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 0edc94f5..01b91f86 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 = [] @@ -455,7 +455,7 @@ class UpdateCommand(TackerCommand): """Update resource's information """ - api = 'servicevm' + api = 'nfv-orchestration' resource = None log = None allow_names = True @@ -503,7 +503,7 @@ class DeleteCommand(TackerCommand): """ - api = 'servicevm' + api = 'nfv-orchestration' resource = None log = None allow_names = True @@ -543,7 +543,7 @@ class ListCommand(TackerCommand, lister.Lister): """ - api = 'servicevm' + api = 'nfv-orchestration' resource = None log = None _formatters = {} @@ -642,7 +642,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 efe2743a..e2e5aed9 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 87b6970d..690f85b4 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,