Commit Graph

123 Commits

Author SHA1 Message Date
8636b3dbb5 Use assertCountEqual instead of assertItemsEqual
The assertItemsEqual method has been removed in Python 3.3 [1] but
it was kept alive by unittest2, imported by testtools. For better
compatibility, change to assertCountEqual.

[1] https://bugs.python.org/issue17866

Change-Id: Iea76915f25eb2e505750d509bdd06758afe324de
(cherry picked from commit b5603cc45c)
2022-12-16 13:33:40 +00:00
Manpreet Kaur
900a1aa78e Fix failing UT in TestListVnfLcmOp
The unit test 'tackerclient.tests.unit.osc.v1.test_vnflcm_op_occs.
TestListVnfLcmOp.test_take_action_with_filter' is failing with below
error message,
DEBUG: TypeError: Object of type 'FormatComplexDataColumn' is not
JSON serializable

Background:
In class TestListVnfLcmOp definition, "create_vnflcm_op_occs" function
is called and list of fake vnflcm op occs dictionary is store in
vnflcm_op_occs_obj.
Now this dictionary is used in two unit test cases "test_take_action"
and "test_take_action_with_filter".
In order to evaluate test results, in "test_take_action" test case,
"get_vnflcm_op_occ_data" function is called using "vnflcm_op_occs_obj"
which appends the data in dictionary.

Later this dictionary "vnflcm_op_occs_obj" is again used in
"test_take_action_with_filter".

Implementation:
This patch creates a separate list of fake vnflcm op occs dictionary for
both the test cases.

This issue has been impacting below reviews as well,
[1] https://review.opendev.org/c/openstack/python-tackerclient/+/636893
[2] https://review.opendev.org/c/openstack/python-tackerclient/+/781314

Co-Authored: Yasufumi Ogawa <yasufum.o@gmail.com>
Closes-Bug: #1919350
Change-Id: I0d62f77cf5d1e9ec0b0a7c404abab83f97b708ba
2022-01-06 06:45:09 +00:00
Aldinson Esto
4e6dc4c031 CLI for Individual VNF LCM Operation Occurrence
Add ``openstack vnflcm op show <vnf-lcm-op-occ-id>``
to python-tackerclient. This command can execute the
get Individual VNF LCM Operation Occurrence by
specifying vnf-lcm-op-occ-id as parameter.

Implements: blueprint support-fundamental-lcm
https://specs.openstack.org/openstack/tacker-specs/specs/wallaby/support-fundamental-vnf-lcm-based-on-ETSI-NFV.html
Change-Id: Ibd24a2aa3ec90fbca4caabbcfb3c8a3883e4eae8
2021-03-11 09:54:10 +09:00
Aldinson Esto
6b29bb78b1 Support CLI for Getting List of VNF LCM Operation Occurrences
Add ``openstack vnflcm op list`` to python-tackerclient.
This command can execute getting the list of VNF LCM
Operation Occurrences. User can specify filters for more
specific results.

Note:
- Filtering for the following attributes:
  operationParams, error, resourceChanges and
  changedInfo is only limited to the parent
  attribute. Currently, child attributes/nested
  attributes are not searchable.

Implements: blueprint support-fundamental-lcm
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/wallaby/support-fundamental-vnf-lcm-based-on-ETSI-NFV.html
Change-Id: Ie0b3399946d2a705011269025102d9380102ca92
2021-03-10 22:24:11 +09:00
Wataru Juso
1299e15f35 Support of Retry VNF command in openstackclient
Add ``openstack vnflcm op retry`` to python-tackerclient.
This command can execute Retry operation.
This API re-executes an LCM that is stopped in the FAILED_TEMP state
from where it was interrupted.

Implements: blueprint support-error-handling
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/wallaby/support-error-handling-based-on-ETSI-NFV.html
Change-Id: I6731d0bcbcd5a4e597596e63c2cd883b3897a145
2021-03-10 11:14:11 +09:00
Wataru Juso
cfe14110d1 Support CLI of Change External VNF Connectivity
Add ``openstack vnflcm op chg-ext-conn`` to python-tackerclient.
This command can execute Change external VNF Connectivity operation.
This API can change VL setting.

Implements: blueprint support-change-external-connectivity
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/wallaby/support-change-external-VNF-connectivity-operation.html
Change-Id: I3a935296646361032665082a4060bc21ff51c1b1
2021-03-10 09:54:49 +09:00
Wataru Juso
58167535c7 Support of Fail VNF command in openstackclient
Add ``openstack vnflcm op fail`` to python-tackerclient.
This command can execute Fail operation.
The API can change operationStatus from "FAILED_TEMP" to "FAILED".

Implements: blueprint support-error-handling
Spec: https://specs.openstack.org/openstack/tacker-specs/specs/wallaby/support-error-handling-based-on-ETSI-NFV.html
Change-Id: I83395e159e28c7e831dfe0ecd90435b3fb18c196
2021-03-08 09:26:29 +09:00
zhangboye
68df82918a Dropping explicit unicode literal
In python 3, all strings are considered as unicode string.

This patch drops the explicit unicode literal (u'...')
or (u"..") appearances from the unicode strings.

Note: The scope of the patch is to drop unicode literal prefix
from python source code files, documentation and comment are overlook.

Co-Authored-By: Manpreet Kaur kaurmanpreet2620@gmail.com
Change-Id: I5316037871109838a03ff4561b7b38dcc56bc447
2021-02-26 10:41:44 +05:30
Wataru Juso
bbe6d2c7e0 Modify operation of scale parameters
Scale command cannot be executed without '--additional-param-file'
option, because there is a problem with branch process. Modify branch
process when using this parameter.

And, I uniform cardinality mismatches of specification definition [1]
in some arguments are resolved. This change has no impact of the order
of setting.

[1]https://specs.openstack.org/openstack/tacker-specs/specs/victoria/support-scale-api-based-on-etsi-nfv-sol.html

Closes-Bug: #1903280
Change-Id: I1dd2c71760112982abd2b4b7da6dbaafd7077614
2021-01-05 14:48:27 +09:00
Yasufumi Ogawa
754f6df5a7 Drop six support
This update is to drop all of six support to move

Closes-bug: #1900389

Change-Id: Ia6c61751203e98d432344dc9a52fe65bdb062af0
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
2020-11-01 18:43:00 +00:00
wangzihao
97f0903242 Remove six.moves.urllib
Remove six.moves.urllib replace with python3 urllib.

Change-Id: Ifd9d1dadfdc78ab7ef21bb648f71ca0e62830264
2020-09-23 19:33:29 +08:00
Koichi Edagawa
8ff2f35476 Support of RollbackVNF command in openstackclient
Supported RollbackVNF command in OpenStack Tacker Client.

Co-Authored-By: Yasufumi Ogawa <yasufum.o@gmail.com>
Implements: blueprint support-etsi-nfv-specs
Change-Id: If3d717b487f653ef98196149c4c849ddac69ec95
2020-09-15 18:35:09 +00:00
Zuul
2a95e61abf Merge "Implementation Artifacts support in Tacker" 2020-09-15 18:04:29 +00:00
LiangLu
9cd8f11d83 Implementation Artifacts support in Tacker
Implements: bp/add-artifacts-vnf-packages

* python-tackerclient

  * Modify ``vnf package show`` command to display ``additionalArtifacts``
    information.
  * Add new OSC command ``vnf package artifact`` to fetch individual artifact
    in an on-boarded VNF package.

Change-Id: Id0694724f2f2e335c14824bc5ca5bf2e67ac4b96
2020-09-14 07:35:55 -04:00
Aldinson Esto
d7f7ea35d2 Support of Scale command in openstackclient
Supported Scale command in Openstack Tacker Client.

Implements: blueprint support-etsi-nfv-specs

Change-Id: I27b670c0aaa0c9b9cbce6ae44e03e5ba6234beb5
2020-09-14 12:13:31 +09:00
Koichi Edagawa
60c268f04d Support of UpdateVNF command in openstackclient
Supported UpdateVNF command in OpenStack Tacker Client.

Change-Id: I20435547e6072c4ca14a5d2cccd7ab77bfea08f8
2020-09-03 11:17:27 +09:00
Joel Capitao
3f504b1d4a Replace assertItemsEqual with assertCountEqual
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - https://github.com/testing-cabal/testtools/issues/286
[4] - https://github.com/testing-cabal/testtools/pull/277

Change-Id: I5a93a561981ad7ce88e5f3ce4032b1c48eb3ae70
2020-06-04 16:08:48 +02:00
Hiroo Kitamura
1d033f9053 Fix exception message
Fix some exception messages because some exception messages are not
outputed as expected.
In addition, the codes that seems to improve readability by explicitly
specifying the arguments are also modified.

Change-Id: I425d15ea9f5a3d0b6132ffd03cb577e583239c3a
Closes-Bug: #1881510
2020-06-01 09:57:28 +09:00
Sean McGinnis
1825b5c509 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I1bae5d2d97304b81588ce059916326e1117136e3
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: Hiroo Kitamura <hiroo.kitamura@ntt-at.co.jp>
2020-05-27 09:59:51 +09:00
Zuul
d720f3203f Merge "Improve readability of vnflcm show command" 2020-05-13 06:51:10 +00:00
Shubham
4ec52e30b2 Display correct fields in output for list command
If user list vnf packages with --exclude_default option, it should
display all attributes except default set of complex.

$ openstack vnf package list --exclude_default
Expected fields:
  'id', 'vnfProductName', 'onboardingState', 'usageState',
  'operationalState', '_links', 'vnfdVersion', 'vnfProvider',
  'vnfSoftwareVersion', 'vnfdId'

Actual fields displayed are:
   'id', 'vnfProductName', 'onboardingState', 'usageState',
   'operationalState'

Fixed this issue and now it will display fields as mentioned above in
expected fields.

Closes-Bug: 1875330

Change-Id: I61da40d2e6e7e42999b7ab2d2441cddde64118d9
2020-05-08 12:29:30 +05:30
Shubham
c6887750f0 Improve readability of vnflcm show command
Display show command data in human_readable format for better
readability for complex attributes of vnf instance like
'vimConnectionInfo', 'instantiatedVnfInfo', '_links'.

Please checkout below link to see the difference in vnflcm show
response data before and after resolving the issue.
http://paste.openstack.org/show/792866

Change-Id: I52684618f7042f5566ea3bed7255d17d2fd61df2
2020-05-08 12:28:25 +05:30
Shubham
e030c9019a Improve readability of vnf package show command
Display show command data in human_readable format for better
readability for complex attributes of vnf package like 'softwareImages',
'checksum', '_links' and 'useDefinedData'.

Please checkout below link to see the difference in vnf package show
response data before and after resolving the issue.
http://paste.openstack.org/show/792305/

Change-Id: I4827437461fd42b4da8a90d7f8ef703625c78cf5
2020-05-08 12:10:46 +05:30
Zuul
d1d41e5f7d Merge "Enhance vnf package list command to support filtering of vnf packages" 2020-04-10 07:21:33 +00:00
Shubham
74cfe26551 Enhance vnf package list command to support filtering of vnf packages
Added support for below arguments.

1)--filter
2)--all_fields
3)--fields
4)--exclude_fields
5)--exclude_default

Change-Id: I2bac92581bb4be3f138107d108ecf9b38605f5cc
2020-04-10 00:23:59 +00:00
Andreas Jaeger
d2f4c1748c Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Change-Id: I7a43ff6d91bad919dcaa450e66ef492a1d3a03ef
2020-04-09 19:55:03 +02:00
Shubham Potale
1736ae7895 Add command for Fetch VNF package API
Added command support for downloading csar vnf package contents.

Change-Id: I6371ebdf0dd9d127ca88bcd721a31036d11ea5fc
Implements: bp enhance-vnf-package-support-part1
2020-04-09 07:21:19 +00:00
Shubham Potale
ac02653f21 Add command to read vnfd of vnf package API
Added command support for fetching VNFD of the vnf package.

Please see results here:-
http://paste.openstack.org/show/789212/

Change-Id: Ifa15ddf7ff306ed2705cf7a170d9e9f512491fba
Implements: bp enhance-vnf-package-support-part1
2020-04-09 07:21:06 +00:00
Shubham Potale
af4d8343ad Add command for update vnf package API
Added command support for updating vnf package.

Please see results here:-
http://paste.openstack.org/show/788463

Change-Id: I0cd32d531db569b7013332fcfaaaefde403e7aed
Implements: bp enhance-vnf-package-support-part1
2020-04-09 07:05:54 +00:00
Zuul
b8f2b39fee Merge "OSC support to heal vnf" 2020-04-01 10:55:49 +00:00
Zuul
05f5fecead Merge "OSC support to list vnfs" 2020-04-01 10:55:35 +00:00
Zuul
a5466fe493 Merge "OSC support to delete and terminate vnf" 2020-04-01 10:54:57 +00:00
Zuul
8f4bc407bb Merge "OSC support to instantiate and show vnf" 2020-04-01 10:54:56 +00:00
Zuul
9b63a7b92f Merge "OSC support to create vnf using vnflcm API" 2020-04-01 10:54:55 +00:00
Shubham Potale
5581c3513f OSC support to heal vnf
Added a new command ``openstack vnflcm heal`` to heal vnf
instance.

Blueprint: support-etsi-nfv-specs
Change-Id: I31165e1def0a53a56e1fcefd1877630712bfab5e
2020-03-31 12:03:01 +00:00
Shubham Potale
9c7708bd53 OSC support to list vnfs
Added a new command ``openstack vnflcm list`` to list the vnf instances.

Blueprint: support-etsi-nfv-specs
Change-Id: I4ef7ac0dd4d4744c74ceb13df6b4438a090ac72a
2020-03-31 12:02:09 +00:00
Shubham Potale
c3a8f25947 OSC support to delete and terminate vnf
Added new commands ``openstack vnflcm delete`` and
``openstack vnflcm terminate``.

Blueprint: support-etsi-nfv-specs
Change-Id: I72ea99c2149621428a34403504f28f9e9b1a3719
2020-03-31 12:01:57 +00:00
Shubham Potale
eae2c896cd OSC support to instantiate and show vnf
Added new commands ``openstack vnflcm instantiate`` and
``openstack vnflcm show``.

Blueprint: support-etsi-nfv-specs
Change-Id: I528e20be6ec01c61b5ca6d646972a9ae22f1c158
2020-03-31 12:01:28 +00:00
Zuul
6eb5a970a9 Merge "Support updating VNF parameters in tackerclient" 2020-03-27 14:21:19 +00:00
Shubham Potale
66efce28d4 OSC support to create vnf using vnflcm API
Added a new command ``openstack vnflcm create`` to create a new vnf.

Blueprint: support-etsi-nfv-specs
Change-Id: Ia90955df6ac141661c3d58e4de4e098c4cb51aab
2020-03-14 11:19:50 +05:30
Alfredo Moralejo
a3fcbb0966 Replace assertItemsEqual with assertCountEqual
assertItemsEqual was removed from Python's unittest.TestCase in
Python 3.3 [1][2]. We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277

Change-Id: I1d77929d26af29e5d060eefdac85a5da2dd145d6
2020-03-13 14:33:05 +01:00
Hiroo Kitamura
a4c2b291b2 Support updating VNF parameters in tackerclient
Implementation to update parameters of created VNF in python-tackerclient.

Change-Id: Ifd5b07bdd1445639db4c23f6b92a3350d4ae22a5
Blueprint: https://blueprints.launchpad.net/tacker/+spec/reservation-vnfm
2020-02-27 09:13:48 +00:00
Shubham Potale
727129d958 Show proper error message for non-existing vnf package
When you pass non-existing vnf package uuid to ``vnf package upload``
command as shown below, it doesn't show user-friendly message as it's
shown in case ``vnf package show`` command.

  $openstack vnf package upload --path sample_vnf_pkg.zip dummy-id
  "404-tackerFault"

This patch fixes this issue and now it will output below error message:

  $openstack vnf package upload --path sample_vnf_pkg.zip dummy-id
  Can not find requested vnf package: dummy-id

Change-Id: I84de0140463d6bd834d3bcc22f6a6cea1fef9130
Closes-Bug: #1799683
2019-10-16 14:50:21 +05:30
Shubham Potale
ffaf88505a Add command for upload vnf package API
Added support vnf package upload command and their unit test cases.

Please see result here.
http://paste.openstack.org/show/766299/

Change-Id: I88da4e209413a00d52c73fc83983ed2f5fd273c6
Implements: bp tosca-csar-mgmt-driver
2019-09-13 10:34:12 +00:00
Shubham Potale
11e23eed22 Add commands for list, show and delete vnf package API's
Added support for below three commands and their unit test cases.
1.vnf package list
2.vnf package show
3.vnf package delete

Please see results here
http://paste.openstack.org/show/774848/

Change-Id: I47e3e99a42aa36ab286fa01802999deb964a168f
Implements: bp tosca-csar-mgmt-driver
2019-09-13 10:32:19 +00:00
Shubham Potale
9940682bc8 OSC support for VNF package APIs
Added support vnf package create command and their unit test cases.

Please see the results here:
http://paste.openstack.org/show/775422/

Change-Id: Idf59847aaf33e360dae696eae819d217ae63570f
Implements: bp tosca-csar-mgmt-driver
2019-09-13 10:27:48 +00:00
Cong Phuoc Hoang
66794e007b Adds support force delete resources
This patch adds '--force' parameter to vnf delete command,
to force delete VNF instances.

e.g: openstack vnf delete --force VNF1

blueprint force-delete-resources

Change-Id: I20aee4ecb66643dfa5fad490956d898f7e851411
2018-11-28 10:25:44 +09:00
Trinh Nguyen
17d108e146 Do not have to mention ssl_ca_cert in vim config file (client)
Current tacker client requires us to mention ssl_ca_cert
and set it to None if we don't want to use ssl cert. This
patch along with another patch on the tacker server side
will make ssl_ca_cert a truly optional config. And, only
the correct ssl_ca_cert will be able to authenticate.

Tacker Server changes: https://review.openstack.org/#/c/546580/

Change-Id: Ic87fe3382e100183c685c3b34768a5a5de889982
2018-02-26 16:17:40 +09:00
gaofei
c5ed02513c Fix typo
Change-Id: I7d6e3c0dea4a4a37fd39f4b0c3150b655069b0c9
2018-02-09 15:22:25 +08:00
Cong Phuoc Hoang
b6ef835d89 Add "cert_verify" in vim_config file to support insecure VIM
Currently, Tacker can not communicate with VIM endpoints that
use SSL. This patch will add cert_verify parameter, user can
set "cert_verify" to False (default value is True) to disable
verifying SSL.

Change-Id: I0af2a0f91ecda2a63cf6233d780e1dd7c064513c
2018-01-13 09:35:13 +00:00