Compare commits

...

8 Commits

Author SHA1 Message Date
Zuul
ad36c1f5b6 Merge "Update TOX/UPPER_CONSTRAINTS_FILE for stable/train" into stable/train 2019-09-23 05:51:35 +00:00
Zuul
ef82c12b25 Merge "Update .gitreview for stable/train" into stable/train 2019-09-23 05:51:14 +00:00
Zuul
8f2bdf326f Merge "Add restFul methods to fix backward compatibility issue" into stable/train 2019-09-23 05:40:21 +00:00
nirajsingh
57692126a0 Add restFul methods to fix backward compatibility issue
Tacker functional tests and applications using old version
of tackerclient might be using post/get/delete/put/list
method interfaces provided by Client in their applications.
These interfaces were removed in the recent changes [1]
because of which tacker tests are failing.

Added post/delete/put/get/list methods back to the Client class.

[1] : https://review.opendev.org/#/c/679956

Closes-Bug: #1844625

Change-Id: I803298dbc16dea9e58ec2a0a5fe3afe431c8532c
(cherry picked from commit 31b7690858)
2019-09-22 19:49:22 +00:00
Hiroya Nakaya
d5a591eec0 fix:osc scale is failed.
parameter which isn't used is removed.
changed Command type.

Closes-Bug:#1834548

Change-Id: Id884f9ebd26f311ebc213bcadff6019aaee5cd3a
(cherry picked from commit 983a2402a4)
2019-09-22 19:49:01 +00:00
Hiroya Nakaya
b98ef94e46 fix:"openstack vnf set" command can't execute
internal function's args is wrong.

Closes-Bug: #1839232

Change-Id: Iea1becdc0ee5dea3a94d843c558f28bce38e4d1c
(cherry picked from commit 9a1020fc84)
2019-09-22 15:40:24 +00:00
be6b25e49a Update TOX/UPPER_CONSTRAINTS_FILE for stable/train
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.

Until the requirements repository has as stable/train branch, tests will
continue to use the upper-constraints list on master.

Change-Id: I937e88fdb199839fc25122835bee43f63c7e3820
2019-09-20 17:43:22 +00:00
f716570413 Update .gitreview for stable/train
Change-Id: I8a3f66189e172a8517462f3c48ed3eb3fed6cf64
2019-09-20 17:43:20 +00:00
4 changed files with 27 additions and 20 deletions

View File

@@ -2,3 +2,4 @@
host=review.opendev.org
port=29418
project=openstack/python-tackerclient.git
defaultbranch=stable/train

View File

@@ -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

View File

@@ -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)

View File

@@ -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