use servicevm as service type for openstack client
Change-Id: I88138064b08a858a6fcdc715bc055e5ad031bcb9
This commit is contained in:
@@ -53,7 +53,7 @@ class HTTPClient(object):
|
|||||||
endpoint_url=None, insecure=False,
|
endpoint_url=None, insecure=False,
|
||||||
endpoint_type='publicURL',
|
endpoint_type='publicURL',
|
||||||
auth_strategy='keystone', ca_cert=None, log_credentials=False,
|
auth_strategy='keystone', ca_cert=None, log_credentials=False,
|
||||||
service_type='network',
|
service_type='servicevm',
|
||||||
**kwargs):
|
**kwargs):
|
||||||
|
|
||||||
self.username = username
|
self.username = username
|
||||||
@@ -249,7 +249,7 @@ class HTTPClient(object):
|
|||||||
|
|
||||||
body = json.loads(body)
|
body = json.loads(body)
|
||||||
for endpoint in body.get('endpoints', []):
|
for endpoint in body.get('endpoints', []):
|
||||||
if (endpoint['type'] == 'network' and
|
if (endpoint['type'] == 'servicevm' and
|
||||||
endpoint.get('region') == self.region_name):
|
endpoint.get('region') == self.region_name):
|
||||||
if self.endpoint_type not in endpoint:
|
if self.endpoint_type not in endpoint:
|
||||||
raise exceptions.EndpointTypeNotFound(
|
raise exceptions.EndpointTypeNotFound(
|
||||||
|
@@ -247,8 +247,8 @@ class TackerShell(app.App):
|
|||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--service-type', metavar='<service-type>',
|
'--service-type', metavar='<service-type>',
|
||||||
default=env('OS_NETWORK_SERVICE_TYPE', default='network'),
|
default=env('OS_SERVICEVM_SERVICE_TYPE', default='servicevm'),
|
||||||
help=_('Defaults to env[OS_NETWORK_SERVICE_TYPE] or network.'))
|
help=_('Defaults to env[OS_SERVICEVM_SERVICE_TYPE] or servicevm.'))
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--endpoint-type', metavar='<endpoint-type>',
|
'--endpoint-type', metavar='<endpoint-type>',
|
||||||
@@ -460,7 +460,7 @@ class TackerShell(app.App):
|
|||||||
|
|
||||||
super(TackerShell, self).initialize_app(argv)
|
super(TackerShell, self).initialize_app(argv)
|
||||||
|
|
||||||
self.api_version = {'network': self.api_version}
|
self.api_version = {'servicevm': self.api_version}
|
||||||
|
|
||||||
# If the user is not asking for help, make sure they
|
# If the user is not asking for help, make sure they
|
||||||
# have given us auth.
|
# have given us auth.
|
||||||
|
@@ -19,7 +19,7 @@ from tackerclient.common import utils
|
|||||||
from tackerclient.openstack.common.gettextutils import _
|
from tackerclient.openstack.common.gettextutils import _
|
||||||
|
|
||||||
|
|
||||||
API_NAME = 'network'
|
API_NAME = 'servicevm'
|
||||||
API_VERSIONS = {
|
API_VERSIONS = {
|
||||||
'1.0': 'tackerclient.v1_0.client.Client',
|
'1.0': 'tackerclient.v1_0.client.Client',
|
||||||
}
|
}
|
||||||
|
@@ -352,7 +352,7 @@ class TackerCommandMeta(abc.ABCMeta):
|
|||||||
@six.add_metaclass(TackerCommandMeta)
|
@six.add_metaclass(TackerCommandMeta)
|
||||||
class TackerCommand(command.OpenStackCommand):
|
class TackerCommand(command.OpenStackCommand):
|
||||||
|
|
||||||
api = 'network'
|
api = 'servicevm'
|
||||||
values_specs = []
|
values_specs = []
|
||||||
json_indent = None
|
json_indent = None
|
||||||
|
|
||||||
@@ -408,7 +408,7 @@ class CreateCommand(TackerCommand, show.ShowOne):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
api = 'network'
|
api = 'servicevm'
|
||||||
resource = None
|
resource = None
|
||||||
log = None
|
log = None
|
||||||
|
|
||||||
@@ -450,7 +450,7 @@ class UpdateCommand(TackerCommand):
|
|||||||
"""Update resource's information
|
"""Update resource's information
|
||||||
"""
|
"""
|
||||||
|
|
||||||
api = 'network'
|
api = 'servicevm'
|
||||||
resource = None
|
resource = None
|
||||||
log = None
|
log = None
|
||||||
allow_names = True
|
allow_names = True
|
||||||
@@ -498,7 +498,7 @@ class DeleteCommand(TackerCommand):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
api = 'network'
|
api = 'servicevm'
|
||||||
resource = None
|
resource = None
|
||||||
log = None
|
log = None
|
||||||
allow_names = True
|
allow_names = True
|
||||||
@@ -538,7 +538,7 @@ class ListCommand(TackerCommand, lister.Lister):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
api = 'network'
|
api = 'servicevm'
|
||||||
resource = None
|
resource = None
|
||||||
log = None
|
log = None
|
||||||
_formatters = {}
|
_formatters = {}
|
||||||
@@ -637,7 +637,7 @@ class ShowCommand(TackerCommand, show.ShowOne):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
api = 'network'
|
api = 'servicevm'
|
||||||
resource = None
|
resource = None
|
||||||
log = None
|
log = None
|
||||||
allow_names = True
|
allow_names = True
|
||||||
|
@@ -52,7 +52,7 @@ KS_TOKEN_RESULT = {
|
|||||||
'internalURL': ENDPOINT_URL,
|
'internalURL': ENDPOINT_URL,
|
||||||
'publicURL': ENDPOINT_URL,
|
'publicURL': ENDPOINT_URL,
|
||||||
'region': REGION}],
|
'region': REGION}],
|
||||||
'type': 'network',
|
'type': 'servicevm',
|
||||||
'name': 'Tacker Service'}
|
'name': 'Tacker Service'}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ KS_TOKEN_RESULT = {
|
|||||||
|
|
||||||
ENDPOINTS_RESULT = {
|
ENDPOINTS_RESULT = {
|
||||||
'endpoints': [{
|
'endpoints': [{
|
||||||
'type': 'network',
|
'type': 'servicevm',
|
||||||
'name': 'Tacker Service',
|
'name': 'Tacker Service',
|
||||||
'region': REGION,
|
'region': REGION,
|
||||||
'adminURL': ENDPOINT_URL,
|
'adminURL': ENDPOINT_URL,
|
||||||
|
@@ -127,8 +127,8 @@ class ShellTest(testtools.TestCase):
|
|||||||
token='', url='', auth_url='http://127.0.0.1:5000/',
|
token='', url='', auth_url='http://127.0.0.1:5000/',
|
||||||
tenant_name='test', tenant_id='tenant_id',
|
tenant_name='test', tenant_id='tenant_id',
|
||||||
username='test', user_id='',
|
username='test', user_id='',
|
||||||
password='test', region_name='', api_version={'network': '1.0'},
|
password='test', region_name='', api_version={'servicevm': '1.0'},
|
||||||
auth_strategy='keystone', service_type='network',
|
auth_strategy='keystone', service_type='servicevm',
|
||||||
endpoint_type='publicURL', insecure=False, ca_cert=None,
|
endpoint_type='publicURL', insecure=False, ca_cert=None,
|
||||||
log_credentials=True)
|
log_credentials=True)
|
||||||
tacker_shell.run_subcommand(['device-template-list'])
|
tacker_shell.run_subcommand(['device-template-list'])
|
||||||
|
@@ -118,7 +118,7 @@ class TestSSL(testtools.TestCase):
|
|||||||
)
|
)
|
||||||
self.mox.ReplayAll()
|
self.mox.ReplayAll()
|
||||||
|
|
||||||
version = {'network': '1.0'}
|
version = {'servicevm': '1.0'}
|
||||||
ClientManager(ca_cert=CA_CERT,
|
ClientManager(ca_cert=CA_CERT,
|
||||||
api_version=version,
|
api_version=version,
|
||||||
url=END_URL,
|
url=END_URL,
|
||||||
|
Reference in New Issue
Block a user