19 Commits

Author SHA1 Message Date
Yasufumi Ogawa
b0c5c55114 Drop Python 2 support
This update is to drop six and all Python 2 support.

Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Change-Id: Ieda51e621ee0477893fd3a0a06e696620c0a8f95
2020-12-26 15:24:33 +00:00
Miguel Caballer
2b62122338 Fix error getting a boolean capability property with value false
Change-Id: I559868a01bc2739d70a8ee56823da539d7f51431
Related-Bug: #1697856
2017-06-20 06:18:04 +00:00
Miguel Caballer
e822838247 Fix _find_host_containing_property function to search for properties in capabilities
Change-Id: Ie21b74c225c7222b5333cab9d680cd728ed35ed7
Related-bug: #1675764
2017-03-27 10:40:00 +02:00
Miguel Caballer
c71c7d37b2 Fix error not considering inheritance in valid_target_types checking in functions
Change-Id: Ifcf0ce478450340597fc112a87c367f5b832faca
Related-Bug: #1672989
2017-03-20 07:14:25 +00:00
sahdev zala
5f762c51ae Add validation for implicit attribute reference
TOSCA attributes can be explicit as part of the type definition
or can be used as implicit via property name. Handle missing
implicit attribute validation with get_attribute function.

Change-Id: I639d819dd55ee828600e6d78a59ab92c3c6e14c3
Closes-Bug: #1622573
2016-11-13 22:21:37 -05:00
gecong1973
d729a61533 Change assertTrue(isinstance()) by optimal assert
Some of tests use different method of assertTrue(isinstance(A, B))
or assertEqual(type(A), B). The correct way is to use assertIsInstance(A, B)
provided by testtools

Change-Id: Id6f69e42bb933d37fab0ad0380fe238f81910070
2016-09-29 09:02:46 +08:00
shangxdy
0617239136 Add validation for parameters
Add validation for all parameters and modification related test cases:
  1. Add property of required in Input class;
  2. For all required inputs which have not default value, must
provide parameters when instantiated a template;
  3. For all required inputs which have default value, may not provide
parameters when instantiated a template;
  4. For all not required inputs, must process the logical of no
parameters in template design(may provide default value, const value, or
process case for none input).

bp: https://blueprints.launchpad.net/tosca-parser/+spec/tosca-input-validation

Change-Id: I5a4a4343f978f387f1b47d36b2210fbcfe7f1b28
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
2016-09-01 01:26:10 +08:00
Miguel Caballer
7e92510a81 Add Token class to manage token function
Change-Id: I43e4922f34a1df38d86b55d1d18b7992fe48c9ab
2016-06-29 13:41:44 +02:00
Miguel Caballer
521bbc1430 Add Support of the optional requirement or capability name get_attribute function
Add full suport to the optional requirement or capability name and the nested attribute name or index.
Also parent_type methond in capabilitytype has been modified to return a CapabilityTypeDef object instead of a string to be similar to other parent_type methods in StatefulEntityType objects.

Change-Id: I1bc9a95739c2e569f3ac1c0c8577db813060c17f
Related-Bug: 1539539
2016-04-21 09:12:03 +02:00
Sahdev Zala
c5151ed2f6 Create concat function and provide validation
Create concat function to validat the concat function specified in the
template.

Change-Id: I25385f6c7555755b5a0cc6913b9fcedaf2559492
Partially-Implements: tosca-intrinsic-functions
2016-03-15 06:30:17 -07:00
Miguel Caballer
b480a11678 Add support for SOURCE and TARGET in get_property and get_attribute functions
Change-Id: I17181c8adb23f7e55c49c780d6bfaba9c26fc985
Related-Bug: 1554507
2016-03-14 15:36:17 +01:00
Miguel Caballer
cc042aae7b Add support for using index and attribute names in the get_attribute function
Change-Id: Ifb9ef61871a22651cb01643996fccebe33184607
Related-Bug: 1539539
2016-03-08 10:55:18 +01:00
Miguel Caballer
2558e8673a Solves the incorrect inheritance of properties in capability objects
Also solves a problem in the EntityType.get_value function that can modify the item definitions

Change-Id: Id65e6fef1d4f4ea96218541427df483609dca44d
Related-Bug: 1544873
2016-02-16 09:49:35 +01:00
Miguel Caballer
5014b33690 Support of nested properties and indexes in get_property function
Change-Id: Ib2f53047cc32a7a0913ee364f1405b8559b11f6c
Related-Bug: 1527206
2016-01-13 10:20:09 +01:00
Miguel Caballer
0d31c251fe Add support for HOST as first argument in get_property function.
It uses a similar solution used in the get_attribute function.

Change-Id: I70b75a415b8d3d78c25c61bdfc351f40d62bae2a
Related-Bug: 1511344
2016-01-07 11:47:42 +01:00
Vahid Hashemian
ea4b3cdfc6 Update error message to a uniform format
Update error messages so they follow the same format.
Also, add i18n where it is missing, fix typo and grammatical
errors in messages, and fix vague messages so they are more
clear.

Change-Id: I06d29b4d8448f8c08fa199a316942f373b968d22
Closes-Bug: #1517271
2015-11-18 16:39:09 -08:00
Vahid Hashemian
8585e8fe1e Full validation of TOSCA templates
Modify the exception handling in TOSCA Parser so that all possible
validation errors are captured during parsing (instead of stopping
the parsing when the first error is encountered) and reported when
parsing is done.

Reporting the line number of each error will be implemented in a
separate patch.

Change-Id: I032c371fe0a73cdf901599ed4ae113f9157d8a1b
Partially-Implements: blueprint tosca-tpl-cli-validator
2015-11-13 16:11:46 -08:00
Vahid Hashemian
a80b6893c2 Fix translation issue with interface inputs and functions
Fix the issue with interface inputs described using intrinsic
functions, that produces an invalid HOT output. Also, include
necessary unit tests, and revert templates that were simplified
due to this issue..

This patch includes changes required in tosca-parser for
resolving the issue.

Change-Id: Iefde09d4633a1cadfe2c6b9ac28c58d2da79a37d
Partial-Bug: #1440247
2015-09-24 10:27:50 -07:00
spzala
0a1568ba38 Redefine respository structure
Change the file structure to make appropriate for stand alone parser.

Change-Id: I6d5259b61b1cd82949262fee4930fa66703ad036
2015-08-25 08:18:39 -07:00