Sometimes importing a nested definition from remote server is failed
for the server is busy. Although we usually can download the definition
before and change the path as local then, cannot for a case if the
contents of the template is fixed and it should not be changed.
This update is avoid such a case as a remedy. The url can be replaced
with any other path by using arg `local_defs` like as below. In this
case, the definition is imported from local path instead of url.
local_defs = {"https://example.org/orig": "/path/to/local/def"}
tosca = ToscaTemplate(template, local_defs=local_defs}
Closes-Bug: #2006796
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Change-Id: Iac88def836970cd976396452ffb9c3d276263d3e
Space seperated list for passenv is no longer acceptable in tox4. This
change fixes the formatting of the passenv list as per this new
standard.
This change also removes skipsdist=true, which causes issues for loading
extensions in tox4.
Change-Id: If541ae03133e3d4a02b38a3e02c13f0b6355e13f
In 2023.1 cycle, we are testing the python 3.10
as voting job so updating the python classifier.
Currently we have python 3.8 unit test job running on
Ubuntu Focal and python 3.10 job on Ubuntu Jammy.
Change-Id: I14b012788ca3c00470683b594280347aeaedee68
For dash-separated attribute names in setup.cfg will not be supported
in future versions, setuptools warns for such a names [1]. This update
is to replace dashes with underscores for the fix.
[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Change-Id: Ia7064518a528e322c366daa6d9a30df9746126ce
The definition of implementation support the single artifact case.
For support the multi artifact case, implement the primary and
dependencies definitions to the implementation.
Implements: blueprint support-multi-artifacts
Change-Id: Ie118add5c1829e54b3e16ea6ea4375bf7f3f9e50
Fix KeyError is raised in get_attribute validation in case of
nested data types.
The data type schema was not correctly managed.
Closes-Bug: 1965089
Change-Id: Ic87a3c429105d6108507de05a31b788538ee2259
Fix InvalidTypeError is raised when a custom def datatype attribute
is requested in a function.
It only required to add custom defs in the DataType validation.
Closes-Bug: 1964972
Change-Id: Ie3413c6d6ba86d0fd5eb819dfc9770b8211badc6
The assertItemsEqual has been replaced with assertCountEqual
since I7c20fec08e5dc9f67b34100c925ea6724bbd25f0 .
This patch replace assertItemsEqual with assertCountEqual.
Additionally, fix warning for deprecrate method skip.
Warning:
/opt/stack/tosca-parser/toscaparser/tests/test_toscatpl.py:
DeprecationWarning: Only valid in 1.8.1 and earlier.
Use skipTest instead. TestCase.skip(self, 'bug #1440247')
Change-Id: I3112be6e984eb3d5f9052ece370a45ac69cf3ad6
The Collections Abstract Base Classes is moved to the
collections.abc module, which was earlier part of the
collections module[1].
The python3 reports a warning for the same-
DeprecationWarning: Using or importing the ABCs from
'collections' instead of from 'collections.abc' is
deprecated since Python 3.3, and in 3.10 it will stop working.
This patch updates to import collection.abc module explicitly.
[1] https://docs.python.org/3/library/collections.abc.html
Change-Id: I18ba70140f9b2b53f2e97e70f64973af9d8953be
1. Fix passing arguments when parent type is taken
2. Take parent interfaces when interfaces are taken
3. Choose custom definitions first when capability type is taken
Change-Id: Ifb74a2a68bf627323ff6bfe5a8d5e0a9a222f86b
Closes-Bug: #1929616
The file babel.cfg is not used anymore.
This patch removes the depreciated file and the translation
sections in setup.cfg (extract_messages, compile_catalog and
update_catalog) as these not needed anymore,
Babel can generate translation files without them.
Change-Id: I64879fdcc2cb2b1395d31947280d39081cf2676b
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.
Change-Id: Idd8fde4c4330c5125ed33f85d12fa6a551165f96
Function `get_operation_output` takes Node or Relationship Template
as first argument.
Change-Id: Ifb9ddf2c021408bdc9f2da18a8c7f3958056709e
Closes-Bug: #1901051
Hacking 4.0.0 has introduce new optimal assert checks.
Please refer [1] for more details.
Additionally Hacking has enabled some new checks by default,
and the next update to the new release will introduce failures
in tosca-parser pep8 jobs.
The main impact is from I122d250cab90964c346e9d53046a97c25054bc00.
This patch adopts new optimal assert check.
[H211]: Change assertTrue(isinstance(A, B)) to assertIsInstance(A, B)
On bumping up the hacking version, below mention pep8 jobs failed.
This patch address the issues now, when the new hacking release starts
being used it will not cause a disruption.
pep8 run-test: commands[0] | flake8
./toscaparser/tests/test_toscatplvalidation.py:502:13:
H211: Use assert{Is,IsNot}instance
[1] https://docs.openstack.org/releasenotes/hacking/unreleased.html#relnotes-4-0-0
Change-Id: I5c83168267be63d4b3908ce6bb844a64bcee837d
In the Node templates interfaces definition, Tosca
parser only recognizes implementation as a file and
not as an artifact name. ETSI SOL definition provides
that Implementation may be an artifact name, and that
the artifact definition will specify the artifact
type and the file. This modification will allow both
artifact name and file to be placed as value in
"Implementation" definition.
This is essential to allow onboarding of VNFD
packages containing the Management Driver definition
that specifies both Implementation definition value
as the Artifact Name.
https://review.opendev.org/#/c/740896/
Change-Id: I192d36499e7b731bbefaf3845f23f85d1e649ca5
This update is to drop six and all Python 2 support.
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Change-Id: Ieda51e621ee0477893fd3a0a06e696620c0a8f95
This update is to switch to wallaby jobs run with the latest tested
runtimes. See Project Testing Interface for the details [1].
[1] https://governance.openstack.org/tc/reference/project-testing-interface.html
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Change-Id: Ic57383420558744f48eeb12eb8cbe6b1ab3dc0e3
Tosca-parser validates the required parameter for node_template but does
not validate the required property of the policy like node_template.
This patch fixes the issue for validation required property of policy.
Change-Id: I137addfa0d7d46e6821573f7770214f5c1754172
Closes-Bug: 1903233