Compare commits
8 Commits
victoria-e
...
train-eol
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad36c1f5b6 | ||
|
|
ef82c12b25 | ||
|
|
8f2bdf326f | ||
|
|
57692126a0 | ||
|
|
d5a591eec0 | ||
|
|
b98ef94e46 | ||
| be6b25e49a | |||
| f716570413 |
@@ -2,3 +2,4 @@
|
||||
host=review.opendev.org
|
||||
port=29418
|
||||
project=openstack/python-tackerclient.git
|
||||
defaultbranch=stable/train
|
||||
|
||||
@@ -392,7 +392,7 @@ class UpdateVNF(command.ShowOne):
|
||||
raise exceptions.InvalidInput(e)
|
||||
if config:
|
||||
body[_VNF]['attributes'] = {'config': config}
|
||||
tackerV10.update_dict(parsed_args, body[_VNF])
|
||||
tackerV10.update_dict(parsed_args, body[_VNF], ['tenant_id'])
|
||||
return body
|
||||
|
||||
def take_action(self, parsed_args):
|
||||
@@ -410,7 +410,7 @@ class UpdateVNF(command.ShowOne):
|
||||
return (display_columns, data)
|
||||
|
||||
|
||||
class ScaleVNF(command.ShowOne):
|
||||
class ScaleVNF(command.Command):
|
||||
_description = _("Scale a VNF.")
|
||||
|
||||
def get_parser(self, prog_name):
|
||||
@@ -430,13 +430,6 @@ class ScaleVNF(command.ShowOne):
|
||||
def args2body(self, parsed_args):
|
||||
args = {}
|
||||
body = {"scale": args}
|
||||
client = self.app.client_manager.tackerclient
|
||||
client.format = parsed_args.request_format
|
||||
_id = tackerV10.find_resourceid_by_name_or_id(
|
||||
client, 'vnf',
|
||||
parsed_args.vnf)
|
||||
parsed_args.vnf_id = _id
|
||||
args['vnf_id'] = parsed_args.vnf_id
|
||||
args['type'] = parsed_args.scaling_type
|
||||
args['policy'] = parsed_args.scaling_policy_name
|
||||
return body
|
||||
@@ -445,12 +438,5 @@ class ScaleVNF(command.ShowOne):
|
||||
client = self.app.client_manager.tackerclient
|
||||
obj_id = tackerV10.find_resourceid_by_name_or_id(
|
||||
client, _VNF, parsed_args.vnf)
|
||||
vnf = client.scale_vnf(obj_id, self.args2body(parsed_args))
|
||||
if vnf[_VNF]['attributes'].get('monitoring_policy'):
|
||||
vnf[_VNF]['attributes']['monitoring_policy'] =\
|
||||
_break_string(vnf[_VNF]['attributes']['monitoring_policy'])
|
||||
display_columns, columns = _get_columns(vnf[_VNF])
|
||||
data = utils.get_item_properties(
|
||||
sdk_utils.DictModel(vnf[_VNF]),
|
||||
columns)
|
||||
return (display_columns, data)
|
||||
client.scale_vnf(obj_id, self.args2body(parsed_args))
|
||||
return
|
||||
|
||||
@@ -795,6 +795,26 @@ class Client(object):
|
||||
|
||||
# LegacyClient methods
|
||||
|
||||
def delete(self, action, body=None, headers=None, params=None):
|
||||
return self.legacy_client.delete(action, body=body, headers=headers,
|
||||
params=params)
|
||||
|
||||
def get(self, action, body=None, headers=None, params=None):
|
||||
return self.legacy_client.get(action, body=body, headers=headers,
|
||||
params=params)
|
||||
|
||||
def post(self, action, body=None, headers=None, params=None):
|
||||
return self.legacy_client.post(action, body=body, headers=headers,
|
||||
params=params)
|
||||
|
||||
def put(self, action, body=None, headers=None, params=None):
|
||||
return self.legacy_client.put(action, body=body, headers=headers,
|
||||
params=params)
|
||||
|
||||
def list(self, collection, path, retrieve_all=True, **params):
|
||||
return self.legacy_client.list(collection, path,
|
||||
retrieve_all=retrieve_all, **params)
|
||||
|
||||
def list_extensions(self, **_params):
|
||||
return self.legacy_client.list_extensions(**_params)
|
||||
|
||||
|
||||
4
tox.ini
4
tox.ini
@@ -11,7 +11,7 @@ setenv = VIRTUAL_ENV={envdir}
|
||||
usedevelop = True
|
||||
install_command = pip install {opts} {packages}
|
||||
deps =
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
|
||||
-r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands = stestr run --slowest {posargs}
|
||||
@@ -33,7 +33,7 @@ commands = sphinx-build -W -b html doc/source doc/build/html
|
||||
[testenv:releasenotes]
|
||||
basepython = python3
|
||||
deps =
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
|
||||
-r{toxinidir}/doc/requirements.txt
|
||||
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||
|
||||
|
||||
Reference in New Issue
Block a user