[GitHub] incubator-ariatosca pull request #207: ARIA-1 Parser test suite

2017-10-31 Thread tliron
GitHub user tliron opened a pull request:

https://github.com/apache/incubator-ariatosca/pull/207

ARIA-1 Parser test suite

This commit additionally fixes many parser bugs revealed by the test
suite, which includes adding validations that were missing.

A new "extensions" tox suite is introduced.

The /tests/parser cases were refactored into /tests/topology and
/tests/extensions.

The Hello World example was fixed and refactored, as it in fact had
invalid TOSCA (it previously passed due to a missing validation).

Parser performance was greatly improved by:

1. Switching to the YAML C library
2. Aggressive caching of parsed presentations
3. The ability to skip importing the TOSCA profile
4. A new deepcopy_fast util
5. A new BlockingExecutor that is much faster for single-threaded use

Unicode is now fully supported for all validation and log message. This
requires the use a unicode (u'' notation) for all .format specs.

Additionally, PyLint comment directives have been standardized by
pushing them to column 100.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/incubator-ariatosca 
ARIA-1-parser-test-suite

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-ariatosca/pull/207.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #207


commit 22cee6d90c5873230eabe7449b5bbccf33222bad
Author: Tal Liron 
Date:   2017-08-17T22:50:27Z

ARIA-1 Parser test suite

This commit additionally fixes many parser bugs revealed by the test
suite, which includes adding validations that were missing.

A new "extensions" tox suite is introduced.

The /tests/parser cases were refactored into /tests/topology and
/tests/extensions.

The Hello World example was fixed and refactored, as it in fact had
invalid TOSCA (it previously passed due to a missing validation).

Parser performance was greatly improved by:

1. Switching to the YAML C library
2. Aggressive caching of parsed presentations
3. The ability to skip importing the TOSCA profile
4. A new deepcopy_fast util
5. A new BlockingExecutor that is much faster for single-threaded use

Unicode is now fully supported for all validation and log message. This
requires the use a unicode (u'' notation) for all .format specs.

Additionally, PyLint comment directives have been standardized by
pushing them to column 100.




---


[GitHub] incubator-ariatosca issue #207: ARIA-1 Parser test suite

2017-10-31 Thread asfgit
Github user asfgit commented on the issue:

https://github.com/apache/incubator-ariatosca/pull/207
  
Can one of the admins verify this patch?


---


[9/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
ARIA-1 Parser test suite

This commit additionally fixes many parser bugs revealed by the test
suite, which includes adding validations that were missing.

A new "extensions" tox suite is introduced.

The /tests/parser cases were refactored into /tests/topology and
/tests/extensions.

The Hello World example was fixed and refactored, as it in fact had
invalid TOSCA (it previously passed due to a missing validation).

Parser performance was greatly improved by:

1. Switching to the YAML C library
2. Aggressive caching of parsed presentations
3. The ability to skip importing the TOSCA profile
4. A new deepcopy_fast util
5. A new BlockingExecutor that is much faster for single-threaded use

Unicode is now fully supported for all validation and log message. This
requires the use a unicode (u'' notation) for all .format specs.

Additionally, PyLint comment directives have been standardized by
pushing them to column 100.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/22cee6d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/22cee6d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/22cee6d9

Branch: refs/heads/ARIA-1-parser-test-suite
Commit: 22cee6d90c5873230eabe7449b5bbccf33222bad
Parents: b1f03ef
Author: Tal Liron 
Authored: Thu Aug 17 17:50:27 2017 -0500
Committer: Tal Liron 
Committed: Tue Oct 31 15:29:41 2017 -0500

--
 .travis.yml |   2 +-
 Makefile|   3 +
 README.rst  |  53 +-
 aria/__init__.py|   4 +-
 aria/cli/commands/services.py   |   2 +-
 aria/cli/utils.py   |   4 +-
 aria/modeling/functions.py  |   2 +-
 aria/modeling/mixins.py |   4 +-
 aria/modeling/orchestration.py  |   2 +-
 aria/modeling/service_common.py |   8 +-
 aria/modeling/service_instance.py   |   2 +-
 aria/modeling/service_template.py   |   4 +-
 aria/modeling/utils.py  |   2 +-
 aria/orchestrator/context/common.py |   6 +-
 aria/orchestrator/context/operation.py  |  12 +-
 aria/orchestrator/context/workflow.py   |   4 +-
 aria/orchestrator/decorators.py |   2 +-
 aria/orchestrator/execution_plugin/common.py|  12 +-
 .../execution_plugin/ctx_proxy/client.py|   4 +-
 .../execution_plugin/ctx_proxy/server.py|  10 +-
 .../execution_plugin/instantiation.py   |  20 +-
 aria/orchestrator/execution_plugin/local.py |   4 +-
 .../execution_plugin/ssh/operations.py  |  46 +-
 .../orchestrator/execution_plugin/ssh/tunnel.py |   4 +-
 aria/orchestrator/plugin.py |  12 +-
 aria/orchestrator/topology/instance_handler.py  | 106 +--
 aria/orchestrator/topology/template_handler.py  |  91 +-
 aria/orchestrator/topology/topology.py  |  10 +-
 aria/orchestrator/workflow_runner.py|   6 +-
 aria/orchestrator/workflows/api/task.py |  10 +-
 aria/orchestrator/workflows/api/task_graph.py   |   8 +-
 .../workflows/builtin/execute_operation.py  |   2 +-
 aria/orchestrator/workflows/core/engine.py  |   2 +-
 .../workflows/core/events_handler.py|   4 +-
 .../workflows/core/graph_compiler.py|   4 +-
 aria/orchestrator/workflows/events_logging.py   |  18 +-
 aria/orchestrator/workflows/exceptions.py   |   8 +-
 aria/orchestrator/workflows/executor/celery.py  |   2 +-
 aria/orchestrator/workflows/executor/dry.py |   6 +-
 aria/orchestrator/workflows/executor/process.py |   8 +-
 aria/orchestrator/workflows/executor/thread.py  |   2 +-
 aria/parser/consumption/context.py  |   6 +-
 aria/parser/consumption/inputs.py   |   2 +-
 aria/parser/consumption/presentation.py | 254 --
 aria/parser/consumption/validation.py   |   2 +-
 aria/parser/loading/file.py |  15 +-
 aria/parser/loading/literal.py  |   3 +
 aria/parser/loading/loader.py   |   3 +
 aria/parser/loading/location.py |  27 +-
 aria/parser/loading/request.py  |  14 +-
 aria/parser/loading/uri.py  |  47 +-
 aria/parser/presentation/__init__.py|  14 +-
 aria/parser/presentation/context.py |  20 +-
 aria/parser/presentation/field_validators.py|  23 +-
 aria/parser/presentation/fields.py  | 125 +--
 aria/parser/presentation/presentation.py|  13 +-
 aria/parser/presentation/presenter.py   |   8 +-
 aria/parser/presentation/source.py  |   2 +-
 aria/parser/presentation/utils.py   |  28 +-
 aria/parser/reading/

[4/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
new file mode 100644
index 000..a4c97a4
--- /dev/null
+++ 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
@@ -0,0 +1,94 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_functions_get_input_unknown(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_input: unknown }
+""").assert_failure()
+
+
+def test_functions_get_input(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  inputs:
+my_input:
+  type: string
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_input: my_input }
+""").assert_success()
+
+
+def test_functions_get_input_nested(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  inputs:
+my_input:
+  type: string
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_input: { concat: [ my, _, input ] } }
+""").assert_success()
+
+
+# Unicode
+
+def test_functions_get_input_unicode(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  類型:
+properties:
+  參數:
+type: string
+topology_template:
+  inputs:
+输入:
+  type: string
+  node_templates:
+模板:
+  type: 類型
+  properties:
+參數: { get_input: 输入 }
+""").assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
new file mode 100644
index 000..ffa2f9c
--- /dev/null
+++ 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_functions_get_nodes_of_type_unknown(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_nodes_of_type: unknown }
+""", import_profile=True).assert_failure()
+
+
+def test_functions_get_nodes_of_type(parser):
+parser.parse_literal(

[8/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/aria/orchestrator/topology/template_handler.py
--
diff --git a/aria/orchestrator/topology/template_handler.py 
b/aria/orchestrator/topology/template_handler.py
index a84a988..3b1948a 100644
--- a/aria/orchestrator/topology/template_handler.py
+++ b/aria/orchestrator/topology/template_handler.py
@@ -69,7 +69,7 @@ class ServiceTemplate(common.TemplateHandlerBase):
 plugin = plugin_specification.plugin
 service.plugins[plugin.name] = plugin
 else:
-self._topology.report('specified plugin not found: 
{0}'.format(
+self._topology.report(u'specified plugin not found: 
{0}'.format(
 plugin_specification.name), 
level=self._topology.Issue.EXTERNAL)
 service.meta_data = self._topology.instantiate(self._model.meta_data)
 
@@ -108,17 +108,18 @@ class ServiceTemplate(common.TemplateHandlerBase):
 def _scaling(self, node_template):
 scaling = node_template.scaling
 
-if any([scaling['min_instances'] < 0,
+if any((scaling['min_instances'] < 0,
 scaling['max_instances'] < scaling['min_instances'],
 scaling['max_instances'] < 0,
 
 scaling['default_instances'] < 0,
 scaling['default_instances'] < scaling['min_instances'],
 scaling['default_instances'] > scaling['max_instances']
-   ]):
+   )):
 self._topology.report(
-'invalid scaling parameters for node template "{0}": 
min={min_instances}, max='
-'{max_instances}, 
default={default_instances}'.format(self._model.name, **scaling),
+u'invalid scaling parameters for node template "{0}": 
min={min_instances}, max='
+u'{max_instances}, 
default={default_instances}'.format(node_template.name,
+   
**scaling),
 level=self._topology.Issue.BETWEEN_TYPES)
 
 return scaling
@@ -150,18 +151,18 @@ class ArtifactTemplate(common.TemplateHandlerBase):
 if self._model.description:
 out_stream.write(out_stream.meta_style(self._model.description))
 with out_stream.indent():
-out_stream.write('Artifact type: {0}'.format(out_stream.type_style(
+out_stream.write(u'Artifact type: 
{0}'.format(out_stream.type_style(
 self._model.type.name)))
-out_stream.write('Source path: 
{0}'.format(out_stream.literal_style(
+out_stream.write(u'Source path: 
{0}'.format(out_stream.literal_style(
 self._model.source_path)))
 if self._model.target_path is not None:
-out_stream.write('Target path: 
{0}'.format(out_stream.literal_style(
+out_stream.write(u'Target path: 
{0}'.format(out_stream.literal_style(
 self._model.target_path)))
 if self._model.repository_url is not None:
-out_stream.write('Repository URL: {0}'.format(
+out_stream.write(u'Repository URL: {0}'.format(
 out_stream.literal_style(self._model.repository_url)))
 if self._model.repository_credential:
-out_stream.write('Repository credential: {0}'.format(
+out_stream.write(u'Repository credential: {0}'.format(
 
out_stream.literal_style(self._model.repository_credential)))
 self._topology.dump(self._model.properties, out_stream, 
title='Properties')
 
@@ -189,17 +190,17 @@ class CapabilityTemplate(common.TemplateHandlerBase):
 if self._model.description:
 out_stream.write(out_stream.meta_style(self._model.description))
 with out_stream.indent():
-out_stream.write('Type: 
{0}'.format(out_stream.type_style(self._model.type.name)))
+out_stream.write(u'Type: 
{0}'.format(out_stream.type_style(self._model.type.name)))
 out_stream.write(
-'Occurrences: {0:d}{1}'.format(
+u'Occurrences: {0:d}{1}'.format(
 self._model.min_occurrences or 0,
-' to {0:d}'.format(self._model.max_occurrences)
+u' to {0:d}'.format(self._model.max_occurrences)
 if self._model.max_occurrences is not None
 else ' or more'))
 if self._model.valid_source_node_types:
-out_stream.write('Valid source node types: {0}'.format(
-', '.join((str(out_stream.type_style(v.name))
-   for v in self._model.valid_source_node_types
+out_stream.write(u'Valid source node types: {0}'.format(
+u', '.join((str(out_stream.type_style(

[1/9] incubator-ariatosca git commit: ARIA-1 Parser test suite [Forced Update!]

2017-10-31 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-1-parser-test-suite b89fdde2f -> 22cee6d90 (forced update)


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py
new file mode 100644
index 000..5c0dd70
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py
@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pytest
+
+from .. import data
+from .mechanisms.utils import matrix
+
+
+# Derived from primitive
+
+@pytest.mark.parametrize('name', data.PRIMITIVE_TYPE_NAMES)
+def test_data_type_derived_from_primitive(parser, name):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+derived_from: {{ name }} 
+""", dict(name=name)).assert_success()
+
+
+# Constraints
+
+@pytest.mark.parametrize('name,value', matrix(
+data.PRIMITIVE_TYPE_NAMES,
+data.NOT_A_LIST
+))
+def test_data_type_constraints_syntax_type(parser, name, value):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+derived_from: string
+constraints: {{ value }}
+""", dict(name=name, value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('name', data.PRIMITIVE_TYPE_NAMES)
+def test_data_type_constraints_syntax_empty(parser, name):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+derived_from: string
+constraints: []
+""", dict(name=name)).assert_success()
+
+
+def test_data_type_constraints_not_derived_from_primitive(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+constraints: [] # can't have constraints if not derived from primitive
+""").assert_failure()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py
new file mode 100644
index 000..7816484
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pytest
+
+from .. import data
+
+
+# Members
+
+@pytest.mark.parametrize('value', data.NOT_A_LIST)
+def test_group_type_members_syntax_type(parser, value):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+group_types:
+  MyType:
+members: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('value', data.NOT_A_STRING)
+def test_group_type_members_syntax_element_type(parser, value):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+group_types:
+  MyType:
+members: [ {{ value }} ]
+""", dict(value=value)).assert_failure()
+
+
+def test_group_type_members_syntax_empty(parser):
+parser.parse_literal("""
+tosca_definitions_ve

[3/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
 
b/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
new file mode 100644
index 000..e9ccc89
--- /dev/null
+++ 
b/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
@@ -0,0 +1,307 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Here we are testing not only artifacts attached to node templates, but also 
artifacts attached to
+node types. The reason is that artifacts attached node types use the same 
property assignment
+(rather than definition) syntax we see in templates.
+"""
+
+import pytest
+
+from ... import data
+from ..mechanisms.utils import matrix
+
+
+# Artifacts attached to a node template
+TEMPLATE_MACROS = """
+{% macro artifacts() %}
+node_types:
+  MyType: {}
+topology_template:
+  node_templates:
+my_node:
+  type: MyType
+  artifacts: {{ caller()|indent(8) }}
+{%- endmacro %}
+"""
+
+# Artifacts attached to a node type
+TYPE_MACROS = """
+{% macro artifacts() %}
+node_types:
+  MyType:
+artifacts: {{ caller()|indent(6) }}
+{%- endmacro %}
+"""
+
+MACROS = {
+'template': TEMPLATE_MACROS,
+'type': TYPE_MACROS
+}
+
+PERMUTATIONS = (
+'template',
+'type'
+)
+
+
+
+# Artifacts section
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, data.NOT_A_DICT))
+def test_node_template_artifacts_section_syntax_type(parser, macros, value):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() -%}
+{{ value }}
+{% endcall %}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifacts_section_syntax_empty(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() -%}
+{}
+{% endcall %}
+""").assert_success()
+
+
+# Artifact
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, data.NOT_A_DICT))
+def test_node_template_artifact_syntax_type(parser, macros, value):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact: {{ value }}
+{% endcall %}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifact_syntax_unsupported(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact:
+  type: MyType
+  unsupported: {}
+{% endcall %}
+""").assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifact_syntax_empty(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact: {} # "type" and "file" are required
+{% endcall %}
+""").assert_failure()
+
+
+# Type
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, 
data.NOT_A_STRING))
+def test_node_template_artifact_type_syntax_type(parser, macros, value):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact:
+  type: {{ value }}
+  file: a file
+{% endcall %}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifact_type_unknown(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact:
+  type: UnknownType
+  file: a file
+{% endcall %}
+""").assert_failure()
+
+
+# File
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, 
data.NOT_A_STRING))
+def test_node_template_artifact_file_syntax_type(parser, macros, value):
+ 

[2/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py
--
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py
new file mode 100644
index 000..54cfd90
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_names_shorthand(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+topology_template:
+  node_templates:
+my_server:
+  type: Compute
+  requirements:
+- local_storage:
+node: my_block_storage
+relationship:
+  type: AttachesTo
+  properties:
+location: /path1/path2
+my_block_storage:
+  type: BlockStorage
+  properties:
+size: 10 GB
+""", import_profile=True).assert_success()
+
+
+def test_names_type_qualified(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+topology_template:
+  node_templates:
+my_server:
+  type: tosca:Compute
+  requirements:
+- local_storage:
+node: my_block_storage
+relationship:
+  type: AttachesTo
+  properties:
+location: /path1/path2
+my_block_storage:
+  type: tosca:BlockStorage
+  properties:
+size: 10 GB
+""", import_profile=True).assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py
--
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py
new file mode 100644
index 000..922f9dc
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_profile(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+""", import_profile=True, validate_normative=True).assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py
new file mode 100644
index 000..9d40e22
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py
@@ -0,0 +1,179 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distribut

[5/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
--
diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
index 9bafeec..e411104 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
@@ -88,7 +88,7 @@ def get_assigned_and_defined_parameter_values(context, 
presentation, field_name)
 definition = definitions[name]
 values[name] = coerce_parameter_value(context, value, 
definition, value.value)
 else:
-context.validation.report('assignment to undefined {0} "{1}" 
in "{2}"'
+context.validation.report(u'assignment to undefined {0} "{1}" 
in "{2}"'
   .format(field_name, name, 
presentation._fullname),
   locator=value._locator, 
level=Issue.BETWEEN_TYPES)
 
@@ -99,7 +99,7 @@ def get_assigned_and_defined_parameter_values(context, 
presentation, field_name)
 if (name not in values) and \
 (('default' in definition._raw) or (field_name == 
'attribute')):
 values[name] = coerce_parameter_value(context, presentation, 
definition,
-  definition.default)
+  definition.default, 
'default')
 
 validate_required_values(context, presentation, values, definitions)
 
@@ -131,7 +131,8 @@ def get_parameter_values(context, presentation, field_name):
   parameter.value)
 else:
 default = parameter.default if hasattr(parameter, 
'default') else None
-values[name] = coerce_parameter_value(context, 
presentation, parameter, default)
+values[name] = coerce_parameter_value(context, 
presentation, parameter, default,
+  'default')
 
 return values
 
@@ -147,11 +148,21 @@ def validate_required_values(context, presentation, 
values, definitions):
 
 if not definitions:
 return
+
+def has_value(name):
+if values is None:
+return False
+value = values.get(name)
+if value is None:
+return False
+if isinstance(value, Value) and (value.value is None):
+return False
+return True
+
 for name, definition in definitions.iteritems():
-if getattr(definition, 'required', False) and \
-((values is None) or (values.get(name) is None)):
-context.validation.report('required property "%s" is not assigned 
a value in "%s"'
-  % (name, presentation._fullname),
+if getattr(definition, 'required', False) and not has_value(name):
+context.validation.report(u'required property "{0}" is not 
assigned a value in "{1}"'
+  .format(name, presentation._fullname),
   
locator=presentation._get_child_locator('properties'),
   level=Issue.BETWEEN_TYPES)
 
@@ -166,14 +177,14 @@ def merge_raw_parameter_definition(context, presentation, 
raw_property_definitio
 our_property_definition._reset_method_cache()
 type2 = our_property_definition._get_type(context)
 
-if type1 != type2:
-if not hasattr(type1, '_is_descendant') or not 
type1._is_descendant(context, type2):
-context.validation.report(
-'property definition type "{0}" is not a descendant of 
overridden '
-'property definition type "{1}"' \
-.format(type1_name, type2._name),
-locator=presentation._get_child_locator(field_name, 
property_name),
-level=Issue.BETWEEN_TYPES)
+if (type1 is not type2) and \
+(not hasattr(type1, '_is_descendant') or not 
type1._is_descendant(context, type2)):
+context.validation.report(
+u'property definition type "{0}" is not a descendant of overridden 
'
+u'property definition type "{1}"' \
+.format(our_property_definition.type, type1_name),
+locator=presentation._get_child_locator(field_name, property_name),
+level=Issue.BETWEEN_TYPES)
 
 merge(raw_property_definition, our_property_definition._raw)
 
@@ -225,6 +236,6 @@ def coerce_parameter_value(context, presentation, 
definition, value, aspect=None
 def convert_parameter_definitions_to_values(context, definitions):
 values = OrderedDict()
 for name, definition in definitions.iteritems():
-default = d

[7/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/aria/parser/presentation/presentation.py
--
diff --git a/aria/parser/presentation/presentation.py 
b/aria/parser/presentation/presentation.py
index 3f9f86d..988d6b3 100644
--- a/aria/parser/presentation/presentation.py
+++ b/aria/parser/presentation/presentation.py
@@ -115,7 +115,7 @@ class PresentationBase(HasCachedMethods):
 if names:
 obj = self._get(*names[:-1])
 if isinstance(obj, dict):
-return obj.get(names[-1])  # pylint: disable=no-member
+return obj.get(names[-1])  
 # pylint: disable=no-member
 return None
 
 def _get_child_locator(self, *names):
@@ -159,7 +159,7 @@ class PresentationBase(HasCachedMethods):
 for field_name in field_names:
 self._dump_field(context, field_name)
 elif hasattr(self, '_iter_field_names'):
-for field_name in self._iter_field_names():  # pylint: 
disable=no-member
+for field_name in self._iter_field_names():
 # pylint: disable=no-member
 self._dump_field(context, field_name)
 else:
 puts(context.style.literal_style(self._raw))
@@ -172,7 +172,7 @@ class PresentationBase(HasCachedMethods):
 delegate to their ``_dump`` methods.
 """
 
-field = self.FIELDS[field_name]  # pylint: disable=no-member
+field = self.FIELDS[field_name]
 # pylint: disable=no-member
 field.dump(self, context)
 
 def _clone(self, container=None):
@@ -199,6 +199,8 @@ class Presentation(PresentationBase):
 """
 
 def _validate(self, context):
+if (not context.presentation.validate_normative) and 
self._get_extension('normative'):
+return
 validate_no_short_form(context, self)
 validate_no_unknown_fields(context, self)
 validate_known_fields(context, self)
@@ -233,8 +235,9 @@ class AsIsPresentation(PresentationBase):
 try:
 validate_primitive(self._raw, self.cls, 
context.validation.allow_primitive_coersion)
 except ValueError as e:
-context.validation.report('"%s" is not a valid "%s": %s'
-  % (self._fullname, self._full_cls_name, 
safe_repr(self._raw)),
+context.validation.report(u'"{0}" is not a valid "{1}": {2}'
+  .format(self._fullname, 
self._full_cls_name,
+  safe_repr(self._raw)),
   locator=self._locator,
   level=Issue.FIELD,
   exception=e)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/aria/parser/presentation/presenter.py
--
diff --git a/aria/parser/presentation/presenter.py 
b/aria/parser/presentation/presenter.py
index 9fd296f..d2f3292 100644
--- a/aria/parser/presentation/presenter.py
+++ b/aria/parser/presentation/presenter.py
@@ -41,10 +41,10 @@ class Presenter(Presentation):
 if tosca_definitions_version is not None \
 and tosca_definitions_version not in 
self.__class__.ALLOWED_IMPORTED_DSL_VERSIONS:
 context.validation.report(
-'import "tosca_definitions_version" is not one of %s: %s'
-% (' or '.join([safe_repr(v)
-for v in 
self.__class__.ALLOWED_IMPORTED_DSL_VERSIONS]),
-   presentation.service_template.tosca_definitions_version),
+u'import "tosca_definitions_version" is not one of {0}: {1}'
+.format(u' or '.join([safe_repr(v)
+  for v in 
self.__class__.ALLOWED_IMPORTED_DSL_VERSIONS]),
+
presentation.service_template.tosca_definitions_version),
 locator=presentation._get_child_locator('inputs'),
 level=Issue.BETWEEN_TYPES)
 return False

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/aria/parser/presentation/source.py
--
diff --git a/aria/parser/presentation/source.py 
b/aria/parser/presentation/source.py
index 4bfb8e1..0bee5d1 100644
--- a/aria/parser/presentation/source.py
+++ b/aria/parser/presentation/source.py
@@ -26,7 +26,7 @@ class PresenterSource(object):
 Presenter sources provide appropriate :class:`Presenter` classes for 
agnostic raw data.
 """
 
-def get_presenter(self, raw):  # pylint: 
disable=unused-argument,no-self-use
+def get_presenter(self, raw):   

[6/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/22cee6d9/extensions/aria_extension_tosca/simple_v1_0/data_types.py
--
diff --git a/extensions/aria_extension_tosca/simple_v1_0/data_types.py 
b/extensions/aria_extension_tosca/simple_v1_0/data_types.py
index 216f1e4..b85caa1 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/data_types.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/data_types.py
@@ -37,13 +37,13 @@ class Timezone(tzinfo):
 super(Timezone, self).__init__()
 self._offset = timedelta(hours=hours, minutes=minutes)
 
-def utcoffset(self, dt): # pylint: disable=unused-argument
+def utcoffset(self, dt):   
 # pylint: disable=unused-argument
 return self._offset
 
-def tzname(self, dt): # pylint: disable=unused-argument
-return str(self._offset)
+def tzname(self, dt):  
 # pylint: disable=unused-argument
+return unicode(self._offset)
 
-def dst(self, dt): # pylint: disable=unused-argument
+def dst(self, dt): 
 # pylint: disable=unused-argument
 return Timezone._ZERO
 
 _ZERO = timedelta(0)
@@ -74,8 +74,8 @@ class Timestamp(object):
 r'(([ 
\t]*)Z|(?P[-+][0-9][0-9])?(:(?P[0-9][0-9])?)?)?$'
 CANONICAL = '%Y-%m-%dT%H:%M:%S'
 
-def __init__(self, entry_schema, constraints, value, aspect): # pylint: 
disable=unused-argument
-value = str(value)
+def __init__(self, entry_schema, constraints, value, aspect):  
 # pylint: disable=unused-argument
+value = unicode(value)
 match = re.match(Timestamp.REGULAR_SHORT, value)
 if match is not None:
 # Parse short form
@@ -116,8 +116,8 @@ class Timestamp(object):
   Timezone(tzhour, tzminute))
 else:
 raise ValueError(
-'timestamp must be formatted as YAML ISO8601 variant or 
"-MM-DD": %s'
-% safe_repr(value))
+u'timestamp must be formatted as YAML ISO8601 variant or 
"-MM-DD": {0}'
+.format(safe_repr(value)))
 
 @property
 def as_datetime_utc(self):
@@ -129,8 +129,8 @@ class Timestamp(object):
 
 def __str__(self):
 the_datetime = self.as_datetime_utc
-return '%s%sZ' \
-% (the_datetime.strftime(Timestamp.CANONICAL), 
Timestamp._fraction_as_str(the_datetime))
+return u'{0}{1}Z'.format(the_datetime.strftime(Timestamp.CANONICAL),
+ Timestamp._fraction_as_str(the_datetime))
 
 def __repr__(self):
 return repr(self.__str__())
@@ -145,7 +145,7 @@ class Timestamp(object):
 
 @staticmethod
 def _fraction_as_str(the_datetime):
-return '{0:g}'.format(the_datetime.microsecond / 100.0).lstrip('0')
+return u'{0:g}'.format(the_datetime.microsecond / 
100.0).lstrip('0')
 
 
 @total_ordering
@@ -165,7 +165,7 @@ class Version(object):
 
 REGEX = \
 r'^(?P\d+)\.(?P\d+)(\.(?P\d+)' + \
-r'((\.(?P\d+))(\-(?P\d+))?)?)?$'
+r'((\.(?P\w+))(\-(?P\d+))?)?)?$'
 
 @staticmethod
 def key(version):
@@ -174,14 +174,13 @@ class Version(object):
 """
 return (version.major, version.minor, version.fix, version.qualifier, 
version.build)
 
-def __init__(self, entry_schema, constraints, value, aspect): # pylint: 
disable=unused-argument
-str_value = str(value)
-match = re.match(Version.REGEX, str_value)
+def __init__(self, entry_schema, constraints, value, aspect):  
 # pylint: disable=unused-argument
+str_value = unicode(value)
+match = re.match(Version.REGEX, str_value, flags=re.UNICODE)
 if match is None:
 raise ValueError(
-'version must be formatted as .'
-'[.[.[-.'
+u'[.[.[-`__
 """
 
-def __init__(self, entry_schema, constraints, value, aspect): # pylint: 
disable=unused-argument
+def __init__(self, entry_schema, constraints, value, aspect):  
 # pylint: disable=unused-argument
 if not isinstance(value, list):
-raise ValueError('range value is not a list: %s' % 
safe_repr(value))
+raise ValueError(u'range value is not a list: 
{0}'.format(safe_repr(value)))
 if len(value) != 2:
-raise ValueError('range value does not have exactly 2 elements: 
%s' % safe_repr(value))
+raise ValueError(u'range value does not have exactly 2 elements: 
{0}'
+ .format(safe_repr(value)))
 
 def is_int(v):
 return isinstance(v, int) 

[13/13] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
ARIA-1 Parser test suite

* Metadata 'template_version' is now version data type
* Unicode support for version
* Better Unicode support for validation issues
* Fix "version" fields in types
* Improve version testing
* Add BlockingExecutor for better single-threaded performance
* Make 'type' required in interface type
* Allow some datatype-typed fields to accept nulls
* Improve validation of "constraints"
* Use YAML C library
* Support Unicode for reporting
* Ensure that primitive fields will not allow "null" value
* Install Python 2.6 only if needed
* Fixes for node template relationship interfaces
* New presentation caching system (replaces old repeat read validation system)
* Avoid importing profile for most parser tests
* Fix race condition due to BlockingExecutor
* Update requirements
* Remove /tests/parser and move into /tests/topology and /tests/extensions
* Allow skipping of normative type validation
* Support Unicode keys in TOSCA map
* Repository can work without importing profile
* Introducing deepcopy_fast
* Fix for coercing node filter constraints that expect integers or strings
* Fixed to hello world


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/b89fdde2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/b89fdde2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/b89fdde2

Branch: refs/heads/ARIA-1-parser-test-suite
Commit: b89fdde2ff2c2a82bf528ec84a2e8da990d0120e
Parents: b1f03ef
Author: Tal Liron 
Authored: Thu Aug 17 17:50:27 2017 -0500
Committer: Tal Liron 
Committed: Tue Oct 31 14:23:02 2017 -0500

--
 .travis.yml |   2 +-
 Makefile|   3 +
 README.rst  |  53 +-
 aria/__init__.py|   4 +-
 aria/cli/commands/services.py   |   2 +-
 aria/cli/utils.py   |   4 +-
 aria/modeling/functions.py  |   2 +-
 aria/modeling/mixins.py |   4 +-
 aria/modeling/orchestration.py  |   2 +-
 aria/modeling/service_common.py |   8 +-
 aria/modeling/service_instance.py   |   2 +-
 aria/modeling/service_template.py   |   4 +-
 aria/modeling/utils.py  |   2 +-
 aria/orchestrator/context/common.py |   6 +-
 aria/orchestrator/context/operation.py  |  12 +-
 aria/orchestrator/context/workflow.py   |   4 +-
 aria/orchestrator/decorators.py |   2 +-
 aria/orchestrator/execution_plugin/common.py|  12 +-
 .../execution_plugin/ctx_proxy/client.py|   4 +-
 .../execution_plugin/ctx_proxy/server.py|  10 +-
 .../execution_plugin/instantiation.py   |  20 +-
 aria/orchestrator/execution_plugin/local.py |   4 +-
 .../execution_plugin/ssh/operations.py  |  46 +-
 .../orchestrator/execution_plugin/ssh/tunnel.py |   4 +-
 aria/orchestrator/plugin.py |  12 +-
 aria/orchestrator/topology/instance_handler.py  | 106 +--
 aria/orchestrator/topology/template_handler.py  |  91 +-
 aria/orchestrator/topology/topology.py  |  10 +-
 aria/orchestrator/workflow_runner.py|   6 +-
 aria/orchestrator/workflows/api/task.py |  10 +-
 aria/orchestrator/workflows/api/task_graph.py   |   8 +-
 .../workflows/builtin/execute_operation.py  |   2 +-
 aria/orchestrator/workflows/core/engine.py  |   2 +-
 .../workflows/core/events_handler.py|   4 +-
 .../workflows/core/graph_compiler.py|   4 +-
 aria/orchestrator/workflows/events_logging.py   |  18 +-
 aria/orchestrator/workflows/exceptions.py   |   8 +-
 aria/orchestrator/workflows/executor/celery.py  |   2 +-
 aria/orchestrator/workflows/executor/dry.py |   6 +-
 aria/orchestrator/workflows/executor/process.py |   8 +-
 aria/orchestrator/workflows/executor/thread.py  |   2 +-
 aria/parser/consumption/context.py  |   6 +-
 aria/parser/consumption/inputs.py   |   2 +-
 aria/parser/consumption/presentation.py | 254 --
 aria/parser/consumption/validation.py   |   2 +-
 aria/parser/loading/file.py |  15 +-
 aria/parser/loading/literal.py  |   3 +
 aria/parser/loading/loader.py   |   3 +
 aria/parser/loading/location.py |  27 +-
 aria/parser/loading/request.py  |  14 +-
 aria/parser/loading/uri.py  |  47 +-
 aria/parser/presentation/__init__.py|  14 +-
 aria/parser/presentation/context.py |  20 +-
 aria/parser/presentation/field_validators.py|  23 +-
 aria/parser/presentation/fields.py  | 125 +--
 aria/parser/presentation/presentation.py| 

[07/13] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
 
b/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
new file mode 100644
index 000..e9ccc89
--- /dev/null
+++ 
b/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
@@ -0,0 +1,307 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Here we are testing not only artifacts attached to node templates, but also 
artifacts attached to
+node types. The reason is that artifacts attached node types use the same 
property assignment
+(rather than definition) syntax we see in templates.
+"""
+
+import pytest
+
+from ... import data
+from ..mechanisms.utils import matrix
+
+
+# Artifacts attached to a node template
+TEMPLATE_MACROS = """
+{% macro artifacts() %}
+node_types:
+  MyType: {}
+topology_template:
+  node_templates:
+my_node:
+  type: MyType
+  artifacts: {{ caller()|indent(8) }}
+{%- endmacro %}
+"""
+
+# Artifacts attached to a node type
+TYPE_MACROS = """
+{% macro artifacts() %}
+node_types:
+  MyType:
+artifacts: {{ caller()|indent(6) }}
+{%- endmacro %}
+"""
+
+MACROS = {
+'template': TEMPLATE_MACROS,
+'type': TYPE_MACROS
+}
+
+PERMUTATIONS = (
+'template',
+'type'
+)
+
+
+
+# Artifacts section
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, data.NOT_A_DICT))
+def test_node_template_artifacts_section_syntax_type(parser, macros, value):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() -%}
+{{ value }}
+{% endcall %}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifacts_section_syntax_empty(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() -%}
+{}
+{% endcall %}
+""").assert_success()
+
+
+# Artifact
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, data.NOT_A_DICT))
+def test_node_template_artifact_syntax_type(parser, macros, value):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact: {{ value }}
+{% endcall %}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifact_syntax_unsupported(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact:
+  type: MyType
+  unsupported: {}
+{% endcall %}
+""").assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifact_syntax_empty(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact: {} # "type" and "file" are required
+{% endcall %}
+""").assert_failure()
+
+
+# Type
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, 
data.NOT_A_STRING))
+def test_node_template_artifact_type_syntax_type(parser, macros, value):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact:
+  type: {{ value }}
+  file: a file
+{% endcall %}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifact_type_unknown(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact:
+  type: UnknownType
+  file: a file
+{% endcall %}
+""").assert_failure()
+
+
+# File
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, 
data.NOT_A_STRING))
+def test_node_template_artifact_file_syntax_type(parser, macros, value):
+ 

[08/13] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
new file mode 100644
index 000..a4c97a4
--- /dev/null
+++ 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
@@ -0,0 +1,94 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_functions_get_input_unknown(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_input: unknown }
+""").assert_failure()
+
+
+def test_functions_get_input(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  inputs:
+my_input:
+  type: string
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_input: my_input }
+""").assert_success()
+
+
+def test_functions_get_input_nested(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  inputs:
+my_input:
+  type: string
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_input: { concat: [ my, _, input ] } }
+""").assert_success()
+
+
+# Unicode
+
+def test_functions_get_input_unicode(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  類型:
+properties:
+  參數:
+type: string
+topology_template:
+  inputs:
+输入:
+  type: string
+  node_templates:
+模板:
+  type: 類型
+  properties:
+參數: { get_input: 输入 }
+""").assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
new file mode 100644
index 000..ffa2f9c
--- /dev/null
+++ 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_functions_get_nodes_of_type_unknown(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_nodes_of_type: unknown }
+""", import_profile=True).assert_failure()
+
+
+def test_functions_get_nodes_of_type(parser):
+parser.parse_literal(

[04/13] incubator-ariatosca git commit: ARIA-405 Remove support for Python 2.6

2017-10-31 Thread emblemparade
ARIA-405 Remove support for Python 2.6

* setup.py now requires Python 2.7
* Upgrade all 3rd party libraries to recent versions
* API changes to networkx
* Stricter yaml.load call for ruamel.yaml
* Remove iter_modules implementation for Python 2.6
* Remove NullHander implementation for Python 2.6
* Remove "py26" tox test environments


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/b1f03efc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/b1f03efc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/b1f03efc

Branch: refs/heads/ARIA-1-parser-test-suite
Commit: b1f03efcedd814f5fe38f051bfa0106cc715586f
Parents: ae89ddb
Author: Tal Liron 
Authored: Mon Oct 30 16:56:57 2017 -0500
Committer: Tal Liron 
Committed: Mon Oct 30 17:08:59 2017 -0500

--
 .travis.yml | 23 ++---
 Makefile|  8 ++--
 README.rst  |  7 +--
 appveyor.yml|  2 +-
 aria/__init__.py|  9 +---
 aria/cli/csar.py|  4 +-
 aria/cli/inputs.py  |  4 +-
 aria/logger.py  | 10 +---
 aria/orchestrator/workflows/api/task_graph.py   | 11 +++--
 aria/utils/imports.py   | 18 ---
 .../simple_v1_0/modeling/__init__.py|  2 +-
 requirements.in | 42 -
 requirements.txt| 28 +--
 setup.py| 15 +++---
 .../test_task_graph_into_execution_graph.py |  2 +-
 tests/requirements.txt  | 11 ++---
 tox.ini | 49 +---
 17 files changed, 80 insertions(+), 165 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b1f03efc/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 958be80..b264ab3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,19 +19,7 @@ sudo: true
 
 language: python
 
-addons:
-  apt:
-sources:
-  - sourceline: 'ppa:fkrull/deadsnakes'
-packages:
-  # Ubuntu 14.04 (trusty) does not come with Python 2.6, so we will 
install it from Felix
-  # Krull's PPA
-  - python2.6
-  - python2.6-dev
-
 python:
-  # We handle Python 2.6 testing from within tox (see tox.ini); note that this 
means that we run
-  # tox itself always from Python 2.7
   - '2.7'
 
 env:
@@ -39,14 +27,11 @@ env:
   # for PyTest's xdist plugin. The reason this is necessary is that 
conventional Travis environments
   # may report a large amount of available CPUs, but they they are greatly 
restricted. Through trial
   # and error we found that more than 1 process may result in failures.
-  - PYTEST_PROCESSES=1 TOX_ENV=pylint_code
+  - PYTEST_PROCESSES=1 TOX_ENV=pylint_core
   - PYTEST_PROCESSES=1 TOX_ENV=pylint_tests
-  - PYTEST_PROCESSES=1 TOX_ENV=py27
-  - PYTEST_PROCESSES=1 TOX_ENV=py26
-  - PYTEST_PROCESSES=1 TOX_ENV=py27e2e
-  - PYTEST_PROCESSES=1 TOX_ENV=py26e2e
-  - PYTEST_PROCESSES=1 TOX_ENV=py27ssh
-  - PYTEST_PROCESSES=1 TOX_ENV=py26ssh
+  - PYTEST_PROCESSES=1 TOX_ENV=core
+  - PYTEST_PROCESSES=1 TOX_ENV=e2e
+  - PYTEST_PROCESSES=1 TOX_ENV=ssh
   - PYTEST_PROCESSES=1 TOX_ENV=docs
 
 before_install:

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b1f03efc/Makefile
--
diff --git a/Makefile b/Makefile
index 9fef3ab..e68538e 100644
--- a/Makefile
+++ b/Makefile
@@ -51,11 +51,11 @@ docs:
 
 test:
pip install --upgrade "tox>=2.7.0"
-   tox -e pylint_code \
+   tox -e pylint_core \
-e pylint_tests \
-   -e py$(PYTHON_VERSION) \
-   -e py$(PYTHON_VERSION)e2e \
-   -e py$(PYTHON_VERSION)ssh \
+   -e core \
+   -e e2e \
+   -e ssh \
-e docs
 
 ./requirements.txt: ./requirements.in

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b1f03efc/README.rst
--
diff --git a/README.rst b/README.rst
index 1985f10..c905277 100644
--- a/README.rst
+++ b/README.rst
@@ -28,7 +28,7 @@ Installation
 
 ARIA is `available on PyPI `__.
 
-ARIA requires Python 2.6/2.7. Python 3 is currently not supported.
+ARIA requires Python 2.7. Python 3 is currently not supported.
 
 To install ARIA directly from PyPI (using a ``wheel``), use::
 
@@ -78,14 +78,12 @@ and run::
 # TODO
 
 
-
 To install ``pip``, either use

[09/13] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
--
diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
index 9bafeec..60d760a 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
@@ -88,7 +88,7 @@ def get_assigned_and_defined_parameter_values(context, 
presentation, field_name)
 definition = definitions[name]
 values[name] = coerce_parameter_value(context, value, 
definition, value.value)
 else:
-context.validation.report('assignment to undefined {0} "{1}" 
in "{2}"'
+context.validation.report(u'assignment to undefined {0} "{1}" 
in "{2}"'
   .format(field_name, name, 
presentation._fullname),
   locator=value._locator, 
level=Issue.BETWEEN_TYPES)
 
@@ -99,7 +99,7 @@ def get_assigned_and_defined_parameter_values(context, 
presentation, field_name)
 if (name not in values) and \
 (('default' in definition._raw) or (field_name == 
'attribute')):
 values[name] = coerce_parameter_value(context, presentation, 
definition,
-  definition.default)
+  definition.default, 
'default')
 
 validate_required_values(context, presentation, values, definitions)
 
@@ -147,11 +147,21 @@ def validate_required_values(context, presentation, 
values, definitions):
 
 if not definitions:
 return
+
+def has_value(name):
+if values is None:
+return False
+value = values.get(name)
+if value is None:
+return False
+if isinstance(value, Value) and (value.value is None):
+return False
+return True
+
 for name, definition in definitions.iteritems():
-if getattr(definition, 'required', False) and \
-((values is None) or (values.get(name) is None)):
-context.validation.report('required property "%s" is not assigned 
a value in "%s"'
-  % (name, presentation._fullname),
+if getattr(definition, 'required', False) and not has_value(name):
+context.validation.report(u'required property "{0}" is not 
assigned a value in "{1}"'
+  .format(name, presentation._fullname),
   
locator=presentation._get_child_locator('properties'),
   level=Issue.BETWEEN_TYPES)
 
@@ -166,14 +176,14 @@ def merge_raw_parameter_definition(context, presentation, 
raw_property_definitio
 our_property_definition._reset_method_cache()
 type2 = our_property_definition._get_type(context)
 
-if type1 != type2:
-if not hasattr(type1, '_is_descendant') or not 
type1._is_descendant(context, type2):
-context.validation.report(
-'property definition type "{0}" is not a descendant of 
overridden '
-'property definition type "{1}"' \
-.format(type1_name, type2._name),
-locator=presentation._get_child_locator(field_name, 
property_name),
-level=Issue.BETWEEN_TYPES)
+if (type1 is not type2) and \
+(not hasattr(type1, '_is_descendant') or not 
type1._is_descendant(context, type2)):
+context.validation.report(
+u'property definition type "{0}" is not a descendant of overridden 
'
+u'property definition type "{1}"' \
+.format(our_property_definition.type, type1_name),
+locator=presentation._get_child_locator(field_name, property_name),
+level=Issue.BETWEEN_TYPES)
 
 merge(raw_property_definition, our_property_definition._raw)
 
@@ -225,6 +235,5 @@ def coerce_parameter_value(context, presentation, 
definition, value, aspect=None
 def convert_parameter_definitions_to_values(context, definitions):
 values = OrderedDict()
 for name, definition in definitions.iteritems():
-default = definition.default
-values[name] = coerce_parameter_value(context, definition, definition, 
default)
+values[name] = coerce_parameter_value(context, definition, definition, 
definition.default)
 return values

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/extensions/aria_extension_tosca/simple_v1_0/modeling/requirements.py
--
diff --git 
a/extensions/aria_extension_tosca/simple_v1_0/modeling/requirements.py 
b/extensions/aria_extension_tosca/simple_v1_0/

[10/13] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/extensions/aria_extension_tosca/simple_v1_0/data_types.py
--
diff --git a/extensions/aria_extension_tosca/simple_v1_0/data_types.py 
b/extensions/aria_extension_tosca/simple_v1_0/data_types.py
index 216f1e4..b85caa1 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/data_types.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/data_types.py
@@ -37,13 +37,13 @@ class Timezone(tzinfo):
 super(Timezone, self).__init__()
 self._offset = timedelta(hours=hours, minutes=minutes)
 
-def utcoffset(self, dt): # pylint: disable=unused-argument
+def utcoffset(self, dt):   
 # pylint: disable=unused-argument
 return self._offset
 
-def tzname(self, dt): # pylint: disable=unused-argument
-return str(self._offset)
+def tzname(self, dt):  
 # pylint: disable=unused-argument
+return unicode(self._offset)
 
-def dst(self, dt): # pylint: disable=unused-argument
+def dst(self, dt): 
 # pylint: disable=unused-argument
 return Timezone._ZERO
 
 _ZERO = timedelta(0)
@@ -74,8 +74,8 @@ class Timestamp(object):
 r'(([ 
\t]*)Z|(?P[-+][0-9][0-9])?(:(?P[0-9][0-9])?)?)?$'
 CANONICAL = '%Y-%m-%dT%H:%M:%S'
 
-def __init__(self, entry_schema, constraints, value, aspect): # pylint: 
disable=unused-argument
-value = str(value)
+def __init__(self, entry_schema, constraints, value, aspect):  
 # pylint: disable=unused-argument
+value = unicode(value)
 match = re.match(Timestamp.REGULAR_SHORT, value)
 if match is not None:
 # Parse short form
@@ -116,8 +116,8 @@ class Timestamp(object):
   Timezone(tzhour, tzminute))
 else:
 raise ValueError(
-'timestamp must be formatted as YAML ISO8601 variant or 
"-MM-DD": %s'
-% safe_repr(value))
+u'timestamp must be formatted as YAML ISO8601 variant or 
"-MM-DD": {0}'
+.format(safe_repr(value)))
 
 @property
 def as_datetime_utc(self):
@@ -129,8 +129,8 @@ class Timestamp(object):
 
 def __str__(self):
 the_datetime = self.as_datetime_utc
-return '%s%sZ' \
-% (the_datetime.strftime(Timestamp.CANONICAL), 
Timestamp._fraction_as_str(the_datetime))
+return u'{0}{1}Z'.format(the_datetime.strftime(Timestamp.CANONICAL),
+ Timestamp._fraction_as_str(the_datetime))
 
 def __repr__(self):
 return repr(self.__str__())
@@ -145,7 +145,7 @@ class Timestamp(object):
 
 @staticmethod
 def _fraction_as_str(the_datetime):
-return '{0:g}'.format(the_datetime.microsecond / 100.0).lstrip('0')
+return u'{0:g}'.format(the_datetime.microsecond / 
100.0).lstrip('0')
 
 
 @total_ordering
@@ -165,7 +165,7 @@ class Version(object):
 
 REGEX = \
 r'^(?P\d+)\.(?P\d+)(\.(?P\d+)' + \
-r'((\.(?P\d+))(\-(?P\d+))?)?)?$'
+r'((\.(?P\w+))(\-(?P\d+))?)?)?$'
 
 @staticmethod
 def key(version):
@@ -174,14 +174,13 @@ class Version(object):
 """
 return (version.major, version.minor, version.fix, version.qualifier, 
version.build)
 
-def __init__(self, entry_schema, constraints, value, aspect): # pylint: 
disable=unused-argument
-str_value = str(value)
-match = re.match(Version.REGEX, str_value)
+def __init__(self, entry_schema, constraints, value, aspect):  
 # pylint: disable=unused-argument
+str_value = unicode(value)
+match = re.match(Version.REGEX, str_value, flags=re.UNICODE)
 if match is None:
 raise ValueError(
-'version must be formatted as .'
-'[.[.[-.'
+u'[.[.[-`__
 """
 
-def __init__(self, entry_schema, constraints, value, aspect): # pylint: 
disable=unused-argument
+def __init__(self, entry_schema, constraints, value, aspect):  
 # pylint: disable=unused-argument
 if not isinstance(value, list):
-raise ValueError('range value is not a list: %s' % 
safe_repr(value))
+raise ValueError(u'range value is not a list: 
{0}'.format(safe_repr(value)))
 if len(value) != 2:
-raise ValueError('range value does not have exactly 2 elements: 
%s' % safe_repr(value))
+raise ValueError(u'range value does not have exactly 2 elements: 
{0}'
+ .format(safe_repr(value)))
 
 def is_int(v):
 return isinstance(v, int) 

[06/13] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py
--
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py
new file mode 100644
index 000..54cfd90
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_names_shorthand(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+topology_template:
+  node_templates:
+my_server:
+  type: Compute
+  requirements:
+- local_storage:
+node: my_block_storage
+relationship:
+  type: AttachesTo
+  properties:
+location: /path1/path2
+my_block_storage:
+  type: BlockStorage
+  properties:
+size: 10 GB
+""", import_profile=True).assert_success()
+
+
+def test_names_type_qualified(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+topology_template:
+  node_templates:
+my_server:
+  type: tosca:Compute
+  requirements:
+- local_storage:
+node: my_block_storage
+relationship:
+  type: AttachesTo
+  properties:
+location: /path1/path2
+my_block_storage:
+  type: tosca:BlockStorage
+  properties:
+size: 10 GB
+""", import_profile=True).assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py
--
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py
new file mode 100644
index 000..922f9dc
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_profile(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+""", import_profile=True, validate_normative=True).assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py
new file mode 100644
index 000..9d40e22
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py
@@ -0,0 +1,179 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distribut

[05/13] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py
new file mode 100644
index 000..5c0dd70
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py
@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pytest
+
+from .. import data
+from .mechanisms.utils import matrix
+
+
+# Derived from primitive
+
+@pytest.mark.parametrize('name', data.PRIMITIVE_TYPE_NAMES)
+def test_data_type_derived_from_primitive(parser, name):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+derived_from: {{ name }} 
+""", dict(name=name)).assert_success()
+
+
+# Constraints
+
+@pytest.mark.parametrize('name,value', matrix(
+data.PRIMITIVE_TYPE_NAMES,
+data.NOT_A_LIST
+))
+def test_data_type_constraints_syntax_type(parser, name, value):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+derived_from: string
+constraints: {{ value }}
+""", dict(name=name, value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('name', data.PRIMITIVE_TYPE_NAMES)
+def test_data_type_constraints_syntax_empty(parser, name):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+derived_from: string
+constraints: []
+""", dict(name=name)).assert_success()
+
+
+def test_data_type_constraints_not_derived_from_primitive(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+constraints: [] # can't have constraints if not derived from primitive
+""").assert_failure()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py
new file mode 100644
index 000..7816484
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pytest
+
+from .. import data
+
+
+# Members
+
+@pytest.mark.parametrize('value', data.NOT_A_LIST)
+def test_group_type_members_syntax_type(parser, value):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+group_types:
+  MyType:
+members: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('value', data.NOT_A_STRING)
+def test_group_type_members_syntax_element_type(parser, value):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+group_types:
+  MyType:
+members: [ {{ value }} ]
+""", dict(value=value)).assert_failure()
+
+
+def test_group_type_members_syntax_empty(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+group_types:
+  MyType:
+members: []
+""").assert_success()
+
+
+def test_group_type_members(pa

[11/13] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/aria/parser/presentation/presentation.py
--
diff --git a/aria/parser/presentation/presentation.py 
b/aria/parser/presentation/presentation.py
index 3f9f86d..988d6b3 100644
--- a/aria/parser/presentation/presentation.py
+++ b/aria/parser/presentation/presentation.py
@@ -115,7 +115,7 @@ class PresentationBase(HasCachedMethods):
 if names:
 obj = self._get(*names[:-1])
 if isinstance(obj, dict):
-return obj.get(names[-1])  # pylint: disable=no-member
+return obj.get(names[-1])  
 # pylint: disable=no-member
 return None
 
 def _get_child_locator(self, *names):
@@ -159,7 +159,7 @@ class PresentationBase(HasCachedMethods):
 for field_name in field_names:
 self._dump_field(context, field_name)
 elif hasattr(self, '_iter_field_names'):
-for field_name in self._iter_field_names():  # pylint: 
disable=no-member
+for field_name in self._iter_field_names():
 # pylint: disable=no-member
 self._dump_field(context, field_name)
 else:
 puts(context.style.literal_style(self._raw))
@@ -172,7 +172,7 @@ class PresentationBase(HasCachedMethods):
 delegate to their ``_dump`` methods.
 """
 
-field = self.FIELDS[field_name]  # pylint: disable=no-member
+field = self.FIELDS[field_name]
 # pylint: disable=no-member
 field.dump(self, context)
 
 def _clone(self, container=None):
@@ -199,6 +199,8 @@ class Presentation(PresentationBase):
 """
 
 def _validate(self, context):
+if (not context.presentation.validate_normative) and 
self._get_extension('normative'):
+return
 validate_no_short_form(context, self)
 validate_no_unknown_fields(context, self)
 validate_known_fields(context, self)
@@ -233,8 +235,9 @@ class AsIsPresentation(PresentationBase):
 try:
 validate_primitive(self._raw, self.cls, 
context.validation.allow_primitive_coersion)
 except ValueError as e:
-context.validation.report('"%s" is not a valid "%s": %s'
-  % (self._fullname, self._full_cls_name, 
safe_repr(self._raw)),
+context.validation.report(u'"{0}" is not a valid "{1}": {2}'
+  .format(self._fullname, 
self._full_cls_name,
+  safe_repr(self._raw)),
   locator=self._locator,
   level=Issue.FIELD,
   exception=e)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/aria/parser/presentation/presenter.py
--
diff --git a/aria/parser/presentation/presenter.py 
b/aria/parser/presentation/presenter.py
index 9fd296f..d2f3292 100644
--- a/aria/parser/presentation/presenter.py
+++ b/aria/parser/presentation/presenter.py
@@ -41,10 +41,10 @@ class Presenter(Presentation):
 if tosca_definitions_version is not None \
 and tosca_definitions_version not in 
self.__class__.ALLOWED_IMPORTED_DSL_VERSIONS:
 context.validation.report(
-'import "tosca_definitions_version" is not one of %s: %s'
-% (' or '.join([safe_repr(v)
-for v in 
self.__class__.ALLOWED_IMPORTED_DSL_VERSIONS]),
-   presentation.service_template.tosca_definitions_version),
+u'import "tosca_definitions_version" is not one of {0}: {1}'
+.format(u' or '.join([safe_repr(v)
+  for v in 
self.__class__.ALLOWED_IMPORTED_DSL_VERSIONS]),
+
presentation.service_template.tosca_definitions_version),
 locator=presentation._get_child_locator('inputs'),
 level=Issue.BETWEEN_TYPES)
 return False

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/aria/parser/presentation/source.py
--
diff --git a/aria/parser/presentation/source.py 
b/aria/parser/presentation/source.py
index 4bfb8e1..0bee5d1 100644
--- a/aria/parser/presentation/source.py
+++ b/aria/parser/presentation/source.py
@@ -26,7 +26,7 @@ class PresenterSource(object):
 Presenter sources provide appropriate :class:`Presenter` classes for 
agnostic raw data.
 """
 
-def get_presenter(self, raw):  # pylint: 
disable=unused-argument,no-self-use
+def get_presenter(self, raw):   

[12/13] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b89fdde2/aria/orchestrator/topology/template_handler.py
--
diff --git a/aria/orchestrator/topology/template_handler.py 
b/aria/orchestrator/topology/template_handler.py
index a84a988..3b1948a 100644
--- a/aria/orchestrator/topology/template_handler.py
+++ b/aria/orchestrator/topology/template_handler.py
@@ -69,7 +69,7 @@ class ServiceTemplate(common.TemplateHandlerBase):
 plugin = plugin_specification.plugin
 service.plugins[plugin.name] = plugin
 else:
-self._topology.report('specified plugin not found: 
{0}'.format(
+self._topology.report(u'specified plugin not found: 
{0}'.format(
 plugin_specification.name), 
level=self._topology.Issue.EXTERNAL)
 service.meta_data = self._topology.instantiate(self._model.meta_data)
 
@@ -108,17 +108,18 @@ class ServiceTemplate(common.TemplateHandlerBase):
 def _scaling(self, node_template):
 scaling = node_template.scaling
 
-if any([scaling['min_instances'] < 0,
+if any((scaling['min_instances'] < 0,
 scaling['max_instances'] < scaling['min_instances'],
 scaling['max_instances'] < 0,
 
 scaling['default_instances'] < 0,
 scaling['default_instances'] < scaling['min_instances'],
 scaling['default_instances'] > scaling['max_instances']
-   ]):
+   )):
 self._topology.report(
-'invalid scaling parameters for node template "{0}": 
min={min_instances}, max='
-'{max_instances}, 
default={default_instances}'.format(self._model.name, **scaling),
+u'invalid scaling parameters for node template "{0}": 
min={min_instances}, max='
+u'{max_instances}, 
default={default_instances}'.format(node_template.name,
+   
**scaling),
 level=self._topology.Issue.BETWEEN_TYPES)
 
 return scaling
@@ -150,18 +151,18 @@ class ArtifactTemplate(common.TemplateHandlerBase):
 if self._model.description:
 out_stream.write(out_stream.meta_style(self._model.description))
 with out_stream.indent():
-out_stream.write('Artifact type: {0}'.format(out_stream.type_style(
+out_stream.write(u'Artifact type: 
{0}'.format(out_stream.type_style(
 self._model.type.name)))
-out_stream.write('Source path: 
{0}'.format(out_stream.literal_style(
+out_stream.write(u'Source path: 
{0}'.format(out_stream.literal_style(
 self._model.source_path)))
 if self._model.target_path is not None:
-out_stream.write('Target path: 
{0}'.format(out_stream.literal_style(
+out_stream.write(u'Target path: 
{0}'.format(out_stream.literal_style(
 self._model.target_path)))
 if self._model.repository_url is not None:
-out_stream.write('Repository URL: {0}'.format(
+out_stream.write(u'Repository URL: {0}'.format(
 out_stream.literal_style(self._model.repository_url)))
 if self._model.repository_credential:
-out_stream.write('Repository credential: {0}'.format(
+out_stream.write(u'Repository credential: {0}'.format(
 
out_stream.literal_style(self._model.repository_credential)))
 self._topology.dump(self._model.properties, out_stream, 
title='Properties')
 
@@ -189,17 +190,17 @@ class CapabilityTemplate(common.TemplateHandlerBase):
 if self._model.description:
 out_stream.write(out_stream.meta_style(self._model.description))
 with out_stream.indent():
-out_stream.write('Type: 
{0}'.format(out_stream.type_style(self._model.type.name)))
+out_stream.write(u'Type: 
{0}'.format(out_stream.type_style(self._model.type.name)))
 out_stream.write(
-'Occurrences: {0:d}{1}'.format(
+u'Occurrences: {0:d}{1}'.format(
 self._model.min_occurrences or 0,
-' to {0:d}'.format(self._model.max_occurrences)
+u' to {0:d}'.format(self._model.max_occurrences)
 if self._model.max_occurrences is not None
 else ' or more'))
 if self._model.valid_source_node_types:
-out_stream.write('Valid source node types: {0}'.format(
-', '.join((str(out_stream.type_style(v.name))
-   for v in self._model.valid_source_node_types
+out_stream.write(u'Valid source node types: {0}'.format(
+u', '.join((str(out_stream.type_style(

[03/13] incubator-ariatosca git commit: ARIA-395 Fix AppVeyor failures due to use of SSL

2017-10-31 Thread emblemparade
ARIA-395 Fix AppVeyor failures due to use of SSL


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/ae89ddb3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/ae89ddb3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/ae89ddb3

Branch: refs/heads/ARIA-1-parser-test-suite
Commit: ae89ddb3009fedc9f56448544a9a7d9dab0e4dd7
Parents: fae7186
Author: Tal Liron 
Authored: Mon Oct 23 12:08:59 2017 -0500
Committer: Tal Liron 
Committed: Mon Oct 30 15:43:46 2017 -0500

--
 appveyor.yml | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/ae89ddb3/appveyor.yml
--
diff --git a/appveyor.yml b/appveyor.yml
index a03b180..1158706 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -14,7 +14,6 @@
 # limitations under the License.
 
 environment:
-
   TOX_ENV: pywin
 
   matrix:
@@ -26,16 +25,16 @@ build: false
 
 install:
   - SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
-  - ps: (new-object 
System.Net.WebClient).Downloadfile('https://bootstrap.pypa.io/get-pip.py', 
'C:\Users\appveyor\get-pip.py')
+  # Note: bootstrap.pypa.io seems to have an SSL configuration problem causing 
downloads to fail, so we will instead get the script from GitHub
+  # -ps: (new-object 
System.Net.WebClient).Downloadfile('https://bootstrap.pypa.io/get-pip.py', 
'C:\Users\Emblem Parade\Desktop\get-pip.py')
+  - ps: (new-object 
System.Net.WebClient).Downloadfile('https://github.com/pypa/get-pip/blob/master/get-pip.py',
 'C:\Users\appveyor\get-pip.py')
   - ps: Start-Process -FilePath "C:\Python27\python.exe" -ArgumentList 
"C:\Users\appveyor\get-pip.py" -Wait -Passthru
 
 before_test:
   - pip install virtualenv --upgrade
   - virtualenv env
-  - 'env\Scripts\activate.bat'
+  - env\Scripts\activate.bat
   - pip install tox
 
 test_script:
-  - pip --version
-  - tox --version
   - tox -e %TOX_ENV%



[01/13] incubator-ariatosca git commit: ARIA-396 Added a link that points to revisions released [Forced Update!]

2017-10-31 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-1-parser-test-suite d233b238d -> b89fdde2f (forced update)


ARIA-396 Added a link that points to revisions released


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/fd553ebd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/fd553ebd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/fd553ebd

Branch: refs/heads/ARIA-1-parser-test-suite
Commit: fd553ebda64344b29d99c6b3c8579ddf6951230f
Parents: 737fff5
Author: Vishwanath Jayaraman 
Authored: Tue Oct 24 12:52:52 2017 -0500
Committer: Vishwanath Jayaraman 
Committed: Tue Oct 24 12:52:52 2017 -0500

--
 README.rst | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fd553ebd/README.rst
--
diff --git a/README.rst b/README.rst
index 6f8885c..0fdf82c 100644
--- a/README.rst
+++ b/README.rst
@@ -132,6 +132,7 @@ Resources
 - `ARIA homepage `__
 - `ARIA wiki `__
 -  `Issue tracker `__
+- `ARIA revisions released 
`__
 
 - Dev mailing list: d...@ariatosca.incubator.apache.org
 - User mailing list: u...@ariatosca.incubator.apache.org



[02/13] incubator-ariatosca git commit: ARIA-389 Apache Code of Conduct and minor spacing correction

2017-10-31 Thread emblemparade
ARIA-389 Apache Code of Conduct and minor spacing correction


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/fae7186c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/fae7186c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/fae7186c

Branch: refs/heads/ARIA-1-parser-test-suite
Commit: fae7186ca7d66f71f3ad61032918e9ff4e151bac
Parents: fd553eb
Author: Thomas Nadeau 
Authored: Mon Oct 23 15:51:00 2017 -0400
Committer: Tal Liron 
Committed: Mon Oct 30 15:39:49 2017 -0500

--
 README.rst | 8 
 1 file changed, 8 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/fae7186c/README.rst
--
diff --git a/README.rst b/README.rst
index 0fdf82c..1985f10 100644
--- a/README.rst
+++ b/README.rst
@@ -51,6 +51,7 @@ and run::
 |
 | Note: These dependencies may have varying licenses which may not be 
compatible with Apache license
 | 2.0.
+|
 
 **Ubuntu/Debian** (tested on Ubuntu 14.04, Ubuntu 16.04)::
 
@@ -166,3 +167,10 @@ ARIA is licensed under the
:target: https://github.com/apache/incubator-ariatosca/pulls
 .. |Closed Pull Requests| image:: 
https://img.shields.io/github/issues-pr-closed-raw/apache/incubator-ariatosca.svg
:target: 
https://github.com/apache/incubator-ariatosca/pulls?q=is%3Apr+is%3Aclosed
+
+Code of Conduct
+---
+
+The ARIA TOSCA Project follows `The Apache Code of Conduct 
`__.
+
+



[6/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/extensions/aria_extension_tosca/simple_v1_0/data_types.py
--
diff --git a/extensions/aria_extension_tosca/simple_v1_0/data_types.py 
b/extensions/aria_extension_tosca/simple_v1_0/data_types.py
index 216f1e4..b85caa1 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/data_types.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/data_types.py
@@ -37,13 +37,13 @@ class Timezone(tzinfo):
 super(Timezone, self).__init__()
 self._offset = timedelta(hours=hours, minutes=minutes)
 
-def utcoffset(self, dt): # pylint: disable=unused-argument
+def utcoffset(self, dt):   
 # pylint: disable=unused-argument
 return self._offset
 
-def tzname(self, dt): # pylint: disable=unused-argument
-return str(self._offset)
+def tzname(self, dt):  
 # pylint: disable=unused-argument
+return unicode(self._offset)
 
-def dst(self, dt): # pylint: disable=unused-argument
+def dst(self, dt): 
 # pylint: disable=unused-argument
 return Timezone._ZERO
 
 _ZERO = timedelta(0)
@@ -74,8 +74,8 @@ class Timestamp(object):
 r'(([ 
\t]*)Z|(?P[-+][0-9][0-9])?(:(?P[0-9][0-9])?)?)?$'
 CANONICAL = '%Y-%m-%dT%H:%M:%S'
 
-def __init__(self, entry_schema, constraints, value, aspect): # pylint: 
disable=unused-argument
-value = str(value)
+def __init__(self, entry_schema, constraints, value, aspect):  
 # pylint: disable=unused-argument
+value = unicode(value)
 match = re.match(Timestamp.REGULAR_SHORT, value)
 if match is not None:
 # Parse short form
@@ -116,8 +116,8 @@ class Timestamp(object):
   Timezone(tzhour, tzminute))
 else:
 raise ValueError(
-'timestamp must be formatted as YAML ISO8601 variant or 
"-MM-DD": %s'
-% safe_repr(value))
+u'timestamp must be formatted as YAML ISO8601 variant or 
"-MM-DD": {0}'
+.format(safe_repr(value)))
 
 @property
 def as_datetime_utc(self):
@@ -129,8 +129,8 @@ class Timestamp(object):
 
 def __str__(self):
 the_datetime = self.as_datetime_utc
-return '%s%sZ' \
-% (the_datetime.strftime(Timestamp.CANONICAL), 
Timestamp._fraction_as_str(the_datetime))
+return u'{0}{1}Z'.format(the_datetime.strftime(Timestamp.CANONICAL),
+ Timestamp._fraction_as_str(the_datetime))
 
 def __repr__(self):
 return repr(self.__str__())
@@ -145,7 +145,7 @@ class Timestamp(object):
 
 @staticmethod
 def _fraction_as_str(the_datetime):
-return '{0:g}'.format(the_datetime.microsecond / 100.0).lstrip('0')
+return u'{0:g}'.format(the_datetime.microsecond / 
100.0).lstrip('0')
 
 
 @total_ordering
@@ -165,7 +165,7 @@ class Version(object):
 
 REGEX = \
 r'^(?P\d+)\.(?P\d+)(\.(?P\d+)' + \
-r'((\.(?P\d+))(\-(?P\d+))?)?)?$'
+r'((\.(?P\w+))(\-(?P\d+))?)?)?$'
 
 @staticmethod
 def key(version):
@@ -174,14 +174,13 @@ class Version(object):
 """
 return (version.major, version.minor, version.fix, version.qualifier, 
version.build)
 
-def __init__(self, entry_schema, constraints, value, aspect): # pylint: 
disable=unused-argument
-str_value = str(value)
-match = re.match(Version.REGEX, str_value)
+def __init__(self, entry_schema, constraints, value, aspect):  
 # pylint: disable=unused-argument
+str_value = unicode(value)
+match = re.match(Version.REGEX, str_value, flags=re.UNICODE)
 if match is None:
 raise ValueError(
-'version must be formatted as .'
-'[.[.[-.'
+u'[.[.[-`__
 """
 
-def __init__(self, entry_schema, constraints, value, aspect): # pylint: 
disable=unused-argument
+def __init__(self, entry_schema, constraints, value, aspect):  
 # pylint: disable=unused-argument
 if not isinstance(value, list):
-raise ValueError('range value is not a list: %s' % 
safe_repr(value))
+raise ValueError(u'range value is not a list: 
{0}'.format(safe_repr(value)))
 if len(value) != 2:
-raise ValueError('range value does not have exactly 2 elements: 
%s' % safe_repr(value))
+raise ValueError(u'range value does not have exactly 2 elements: 
{0}'
+ .format(safe_repr(value)))
 
 def is_int(v):
 return isinstance(v, int) 

[7/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/aria/parser/presentation/presentation.py
--
diff --git a/aria/parser/presentation/presentation.py 
b/aria/parser/presentation/presentation.py
index 3f9f86d..988d6b3 100644
--- a/aria/parser/presentation/presentation.py
+++ b/aria/parser/presentation/presentation.py
@@ -115,7 +115,7 @@ class PresentationBase(HasCachedMethods):
 if names:
 obj = self._get(*names[:-1])
 if isinstance(obj, dict):
-return obj.get(names[-1])  # pylint: disable=no-member
+return obj.get(names[-1])  
 # pylint: disable=no-member
 return None
 
 def _get_child_locator(self, *names):
@@ -159,7 +159,7 @@ class PresentationBase(HasCachedMethods):
 for field_name in field_names:
 self._dump_field(context, field_name)
 elif hasattr(self, '_iter_field_names'):
-for field_name in self._iter_field_names():  # pylint: 
disable=no-member
+for field_name in self._iter_field_names():
 # pylint: disable=no-member
 self._dump_field(context, field_name)
 else:
 puts(context.style.literal_style(self._raw))
@@ -172,7 +172,7 @@ class PresentationBase(HasCachedMethods):
 delegate to their ``_dump`` methods.
 """
 
-field = self.FIELDS[field_name]  # pylint: disable=no-member
+field = self.FIELDS[field_name]
 # pylint: disable=no-member
 field.dump(self, context)
 
 def _clone(self, container=None):
@@ -199,6 +199,8 @@ class Presentation(PresentationBase):
 """
 
 def _validate(self, context):
+if (not context.presentation.validate_normative) and 
self._get_extension('normative'):
+return
 validate_no_short_form(context, self)
 validate_no_unknown_fields(context, self)
 validate_known_fields(context, self)
@@ -233,8 +235,9 @@ class AsIsPresentation(PresentationBase):
 try:
 validate_primitive(self._raw, self.cls, 
context.validation.allow_primitive_coersion)
 except ValueError as e:
-context.validation.report('"%s" is not a valid "%s": %s'
-  % (self._fullname, self._full_cls_name, 
safe_repr(self._raw)),
+context.validation.report(u'"{0}" is not a valid "{1}": {2}'
+  .format(self._fullname, 
self._full_cls_name,
+  safe_repr(self._raw)),
   locator=self._locator,
   level=Issue.FIELD,
   exception=e)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/aria/parser/presentation/presenter.py
--
diff --git a/aria/parser/presentation/presenter.py 
b/aria/parser/presentation/presenter.py
index 9fd296f..d2f3292 100644
--- a/aria/parser/presentation/presenter.py
+++ b/aria/parser/presentation/presenter.py
@@ -41,10 +41,10 @@ class Presenter(Presentation):
 if tosca_definitions_version is not None \
 and tosca_definitions_version not in 
self.__class__.ALLOWED_IMPORTED_DSL_VERSIONS:
 context.validation.report(
-'import "tosca_definitions_version" is not one of %s: %s'
-% (' or '.join([safe_repr(v)
-for v in 
self.__class__.ALLOWED_IMPORTED_DSL_VERSIONS]),
-   presentation.service_template.tosca_definitions_version),
+u'import "tosca_definitions_version" is not one of {0}: {1}'
+.format(u' or '.join([safe_repr(v)
+  for v in 
self.__class__.ALLOWED_IMPORTED_DSL_VERSIONS]),
+
presentation.service_template.tosca_definitions_version),
 locator=presentation._get_child_locator('inputs'),
 level=Issue.BETWEEN_TYPES)
 return False

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/aria/parser/presentation/source.py
--
diff --git a/aria/parser/presentation/source.py 
b/aria/parser/presentation/source.py
index 4bfb8e1..0bee5d1 100644
--- a/aria/parser/presentation/source.py
+++ b/aria/parser/presentation/source.py
@@ -26,7 +26,7 @@ class PresenterSource(object):
 Presenter sources provide appropriate :class:`Presenter` classes for 
agnostic raw data.
 """
 
-def get_presenter(self, raw):  # pylint: 
disable=unused-argument,no-self-use
+def get_presenter(self, raw):   

[3/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
 
b/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
new file mode 100644
index 000..e9ccc89
--- /dev/null
+++ 
b/tests/extensions/aria_extension_tosca/simple_v1_0/templates/node_template/test_node_template_artifacts.py
@@ -0,0 +1,307 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Here we are testing not only artifacts attached to node templates, but also 
artifacts attached to
+node types. The reason is that artifacts attached node types use the same 
property assignment
+(rather than definition) syntax we see in templates.
+"""
+
+import pytest
+
+from ... import data
+from ..mechanisms.utils import matrix
+
+
+# Artifacts attached to a node template
+TEMPLATE_MACROS = """
+{% macro artifacts() %}
+node_types:
+  MyType: {}
+topology_template:
+  node_templates:
+my_node:
+  type: MyType
+  artifacts: {{ caller()|indent(8) }}
+{%- endmacro %}
+"""
+
+# Artifacts attached to a node type
+TYPE_MACROS = """
+{% macro artifacts() %}
+node_types:
+  MyType:
+artifacts: {{ caller()|indent(6) }}
+{%- endmacro %}
+"""
+
+MACROS = {
+'template': TEMPLATE_MACROS,
+'type': TYPE_MACROS
+}
+
+PERMUTATIONS = (
+'template',
+'type'
+)
+
+
+
+# Artifacts section
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, data.NOT_A_DICT))
+def test_node_template_artifacts_section_syntax_type(parser, macros, value):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() -%}
+{{ value }}
+{% endcall %}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifacts_section_syntax_empty(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() -%}
+{}
+{% endcall %}
+""").assert_success()
+
+
+# Artifact
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, data.NOT_A_DICT))
+def test_node_template_artifact_syntax_type(parser, macros, value):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact: {{ value }}
+{% endcall %}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifact_syntax_unsupported(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact:
+  type: MyType
+  unsupported: {}
+{% endcall %}
+""").assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifact_syntax_empty(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact: {} # "type" and "file" are required
+{% endcall %}
+""").assert_failure()
+
+
+# Type
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, 
data.NOT_A_STRING))
+def test_node_template_artifact_type_syntax_type(parser, macros, value):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact:
+  type: {{ value }}
+  file: a file
+{% endcall %}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('macros', PERMUTATIONS)
+def test_node_template_artifact_type_unknown(parser, macros):
+parser.parse_literal(MACROS[macros] + """
+tosca_definitions_version: tosca_simple_yaml_1_0
+{%- call artifacts() %}
+my_artifact:
+  type: UnknownType
+  file: a file
+{% endcall %}
+""").assert_failure()
+
+
+# File
+
+@pytest.mark.parametrize('macros,value', matrix(PERMUTATIONS, 
data.NOT_A_STRING))
+def test_node_template_artifact_file_syntax_type(parser, macros, value):
+ 

[2/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py
--
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py
new file mode 100644
index 000..54cfd90
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/test_names.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_names_shorthand(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+topology_template:
+  node_templates:
+my_server:
+  type: Compute
+  requirements:
+- local_storage:
+node: my_block_storage
+relationship:
+  type: AttachesTo
+  properties:
+location: /path1/path2
+my_block_storage:
+  type: BlockStorage
+  properties:
+size: 10 GB
+""", import_profile=True).assert_success()
+
+
+def test_names_type_qualified(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+topology_template:
+  node_templates:
+my_server:
+  type: tosca:Compute
+  requirements:
+- local_storage:
+node: my_block_storage
+relationship:
+  type: AttachesTo
+  properties:
+location: /path1/path2
+my_block_storage:
+  type: tosca:BlockStorage
+  properties:
+size: 10 GB
+""", import_profile=True).assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py
--
diff --git a/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py
new file mode 100644
index 000..922f9dc
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/test_profile.py
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_profile(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+""", import_profile=True, validate_normative=True).assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py
new file mode 100644
index 000..9d40e22
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/test_repositories.py
@@ -0,0 +1,179 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distribut

[4/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
new file mode 100644
index 000..a4c97a4
--- /dev/null
+++ 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_input.py
@@ -0,0 +1,94 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_functions_get_input_unknown(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_input: unknown }
+""").assert_failure()
+
+
+def test_functions_get_input(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  inputs:
+my_input:
+  type: string
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_input: my_input }
+""").assert_success()
+
+
+def test_functions_get_input_nested(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  inputs:
+my_input:
+  type: string
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_input: { concat: [ my, _, input ] } }
+""").assert_success()
+
+
+# Unicode
+
+def test_functions_get_input_unicode(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  類型:
+properties:
+  參數:
+type: string
+topology_template:
+  inputs:
+输入:
+  type: string
+  node_templates:
+模板:
+  type: 類型
+  properties:
+參數: { get_input: 输入 }
+""").assert_success()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
new file mode 100644
index 000..ffa2f9c
--- /dev/null
+++ 
b/tests/extensions/aria_extension_tosca/simple_v1_0/functions/test_function_get_nodes_of_type.py
@@ -0,0 +1,70 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+def test_functions_get_nodes_of_type_unknown(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+node_types:
+  MyType:
+properties:
+  my_parameter:
+type: string
+topology_template:
+  node_templates:
+my_node:
+  type: MyType
+  properties:
+my_parameter: { get_nodes_of_type: unknown }
+""", import_profile=True).assert_failure()
+
+
+def test_functions_get_nodes_of_type(parser):
+parser.parse_literal(

[1/9] incubator-ariatosca git commit: ARIA-1 Parser test suite [Forced Update!]

2017-10-31 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-1-parser-test-suite 5792ac747 -> d233b238d (forced update)


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py
new file mode 100644
index 000..5c0dd70
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_data_type.py
@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pytest
+
+from .. import data
+from .mechanisms.utils import matrix
+
+
+# Derived from primitive
+
+@pytest.mark.parametrize('name', data.PRIMITIVE_TYPE_NAMES)
+def test_data_type_derived_from_primitive(parser, name):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+derived_from: {{ name }} 
+""", dict(name=name)).assert_success()
+
+
+# Constraints
+
+@pytest.mark.parametrize('name,value', matrix(
+data.PRIMITIVE_TYPE_NAMES,
+data.NOT_A_LIST
+))
+def test_data_type_constraints_syntax_type(parser, name, value):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+derived_from: string
+constraints: {{ value }}
+""", dict(name=name, value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('name', data.PRIMITIVE_TYPE_NAMES)
+def test_data_type_constraints_syntax_empty(parser, name):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+derived_from: string
+constraints: []
+""", dict(name=name)).assert_success()
+
+
+def test_data_type_constraints_not_derived_from_primitive(parser):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+data_types:
+  MyType:
+constraints: [] # can't have constraints if not derived from primitive
+""").assert_failure()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py
--
diff --git 
a/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py 
b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py
new file mode 100644
index 000..7816484
--- /dev/null
+++ b/tests/extensions/aria_extension_tosca/simple_v1_0/types/test_group_type.py
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import pytest
+
+from .. import data
+
+
+# Members
+
+@pytest.mark.parametrize('value', data.NOT_A_LIST)
+def test_group_type_members_syntax_type(parser, value):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+group_types:
+  MyType:
+members: {{ value }}
+""", dict(value=value)).assert_failure()
+
+
+@pytest.mark.parametrize('value', data.NOT_A_STRING)
+def test_group_type_members_syntax_element_type(parser, value):
+parser.parse_literal("""
+tosca_definitions_version: tosca_simple_yaml_1_0
+group_types:
+  MyType:
+members: [ {{ value }} ]
+""", dict(value=value)).assert_failure()
+
+
+def test_group_type_members_syntax_empty(parser):
+parser.parse_literal("""
+tosca_definitions_ve

[9/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
ARIA-1 Parser test suite

* Metadata 'template_version' is now version data type
* Unicode support for version
* Better Unicode support for validation issues
* Fix "version" fields in types
* Improve version testing
* Add BlockingExecutor for better single-threaded performance
* Make 'type' required in interface type
* Allow some datatype-typed fields to accept nulls
* Improve validation of "constraints"
* Use YAML C library
* Support Unicode for reporting
* Ensure that primitive fields will not allow "null" value
* Install Python 2.6 only if needed
* Fixes for node template relationship interfaces
* New presentation caching system (replaces old repeat read validation system)
* Avoid importing profile for most parser tests
* Fix race condition due to BlockingExecutor
* Update requirements
* Remove /tests/parser and move into /tests/topology and /tests/extensions
* Allow skipping of normative type validation
* Support Unicode keys in TOSCA map
* Repository can work without importing profile
* Introducing deepcopy_fast
* Fix for coercing node filter constraints that expect integers or strings
* Fixed to hello world


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/d233b238
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/d233b238
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/d233b238

Branch: refs/heads/ARIA-1-parser-test-suite
Commit: d233b238d9062ecc3c173e3d97de0b8f34b57755
Parents: 737fff5
Author: Tal Liron 
Authored: Thu Aug 17 17:50:27 2017 -0500
Committer: Tal Liron 
Committed: Tue Oct 31 13:51:24 2017 -0500

--
 .travis.yml |  32 +-
 Makefile|   3 +
 README.rst  |   8 +-
 appveyor.yml|   3 +-
 aria/__init__.py|   4 +-
 aria/cli/commands/services.py   |   2 +-
 aria/cli/utils.py   |   4 +-
 aria/modeling/functions.py  |   2 +-
 aria/modeling/mixins.py |   4 +-
 aria/modeling/orchestration.py  |   2 +-
 aria/modeling/service_common.py |   8 +-
 aria/modeling/service_instance.py   |   2 +-
 aria/modeling/service_template.py   |   4 +-
 aria/modeling/utils.py  |   2 +-
 aria/orchestrator/context/common.py |   6 +-
 aria/orchestrator/context/operation.py  |  12 +-
 aria/orchestrator/context/workflow.py   |   4 +-
 aria/orchestrator/decorators.py |   2 +-
 aria/orchestrator/execution_plugin/common.py|  12 +-
 .../execution_plugin/ctx_proxy/client.py|   4 +-
 .../execution_plugin/ctx_proxy/server.py|  10 +-
 .../execution_plugin/instantiation.py   |  20 +-
 aria/orchestrator/execution_plugin/local.py |   4 +-
 .../execution_plugin/ssh/operations.py  |  46 +-
 .../orchestrator/execution_plugin/ssh/tunnel.py |   4 +-
 aria/orchestrator/plugin.py |  12 +-
 aria/orchestrator/topology/instance_handler.py  | 106 +--
 aria/orchestrator/topology/template_handler.py  |  91 +-
 aria/orchestrator/topology/topology.py  |  10 +-
 aria/orchestrator/workflow_runner.py|   6 +-
 aria/orchestrator/workflows/api/task.py |  10 +-
 aria/orchestrator/workflows/api/task_graph.py   |   8 +-
 .../workflows/builtin/execute_operation.py  |   2 +-
 aria/orchestrator/workflows/core/engine.py  |   2 +-
 .../workflows/core/events_handler.py|   4 +-
 .../workflows/core/graph_compiler.py|   4 +-
 aria/orchestrator/workflows/events_logging.py   |  18 +-
 aria/orchestrator/workflows/exceptions.py   |   8 +-
 aria/orchestrator/workflows/executor/celery.py  |   2 +-
 aria/orchestrator/workflows/executor/dry.py |   6 +-
 aria/orchestrator/workflows/executor/process.py |   8 +-
 aria/orchestrator/workflows/executor/thread.py  |   2 +-
 aria/parser/consumption/context.py  |   6 +-
 aria/parser/consumption/inputs.py   |   2 +-
 aria/parser/consumption/presentation.py | 254 --
 aria/parser/consumption/validation.py   |   2 +-
 aria/parser/loading/file.py |  15 +-
 aria/parser/loading/literal.py  |   3 +
 aria/parser/loading/loader.py   |   3 +
 aria/parser/loading/location.py |  27 +-
 aria/parser/loading/request.py  |  14 +-
 aria/parser/loading/uri.py  |  47 +-
 aria/parser/presentation/__init__.py|  14 +-
 aria/parser/presentation/context.py |  20 +-
 aria/parser/presentation/field_validators.py|  23 +-
 aria/parser/presentation/fields.py  | 1

[8/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/aria/orchestrator/topology/template_handler.py
--
diff --git a/aria/orchestrator/topology/template_handler.py 
b/aria/orchestrator/topology/template_handler.py
index a84a988..3b1948a 100644
--- a/aria/orchestrator/topology/template_handler.py
+++ b/aria/orchestrator/topology/template_handler.py
@@ -69,7 +69,7 @@ class ServiceTemplate(common.TemplateHandlerBase):
 plugin = plugin_specification.plugin
 service.plugins[plugin.name] = plugin
 else:
-self._topology.report('specified plugin not found: 
{0}'.format(
+self._topology.report(u'specified plugin not found: 
{0}'.format(
 plugin_specification.name), 
level=self._topology.Issue.EXTERNAL)
 service.meta_data = self._topology.instantiate(self._model.meta_data)
 
@@ -108,17 +108,18 @@ class ServiceTemplate(common.TemplateHandlerBase):
 def _scaling(self, node_template):
 scaling = node_template.scaling
 
-if any([scaling['min_instances'] < 0,
+if any((scaling['min_instances'] < 0,
 scaling['max_instances'] < scaling['min_instances'],
 scaling['max_instances'] < 0,
 
 scaling['default_instances'] < 0,
 scaling['default_instances'] < scaling['min_instances'],
 scaling['default_instances'] > scaling['max_instances']
-   ]):
+   )):
 self._topology.report(
-'invalid scaling parameters for node template "{0}": 
min={min_instances}, max='
-'{max_instances}, 
default={default_instances}'.format(self._model.name, **scaling),
+u'invalid scaling parameters for node template "{0}": 
min={min_instances}, max='
+u'{max_instances}, 
default={default_instances}'.format(node_template.name,
+   
**scaling),
 level=self._topology.Issue.BETWEEN_TYPES)
 
 return scaling
@@ -150,18 +151,18 @@ class ArtifactTemplate(common.TemplateHandlerBase):
 if self._model.description:
 out_stream.write(out_stream.meta_style(self._model.description))
 with out_stream.indent():
-out_stream.write('Artifact type: {0}'.format(out_stream.type_style(
+out_stream.write(u'Artifact type: 
{0}'.format(out_stream.type_style(
 self._model.type.name)))
-out_stream.write('Source path: 
{0}'.format(out_stream.literal_style(
+out_stream.write(u'Source path: 
{0}'.format(out_stream.literal_style(
 self._model.source_path)))
 if self._model.target_path is not None:
-out_stream.write('Target path: 
{0}'.format(out_stream.literal_style(
+out_stream.write(u'Target path: 
{0}'.format(out_stream.literal_style(
 self._model.target_path)))
 if self._model.repository_url is not None:
-out_stream.write('Repository URL: {0}'.format(
+out_stream.write(u'Repository URL: {0}'.format(
 out_stream.literal_style(self._model.repository_url)))
 if self._model.repository_credential:
-out_stream.write('Repository credential: {0}'.format(
+out_stream.write(u'Repository credential: {0}'.format(
 
out_stream.literal_style(self._model.repository_credential)))
 self._topology.dump(self._model.properties, out_stream, 
title='Properties')
 
@@ -189,17 +190,17 @@ class CapabilityTemplate(common.TemplateHandlerBase):
 if self._model.description:
 out_stream.write(out_stream.meta_style(self._model.description))
 with out_stream.indent():
-out_stream.write('Type: 
{0}'.format(out_stream.type_style(self._model.type.name)))
+out_stream.write(u'Type: 
{0}'.format(out_stream.type_style(self._model.type.name)))
 out_stream.write(
-'Occurrences: {0:d}{1}'.format(
+u'Occurrences: {0:d}{1}'.format(
 self._model.min_occurrences or 0,
-' to {0:d}'.format(self._model.max_occurrences)
+u' to {0:d}'.format(self._model.max_occurrences)
 if self._model.max_occurrences is not None
 else ' or more'))
 if self._model.valid_source_node_types:
-out_stream.write('Valid source node types: {0}'.format(
-', '.join((str(out_stream.type_style(v.name))
-   for v in self._model.valid_source_node_types
+out_stream.write(u'Valid source node types: {0}'.format(
+u', '.join((str(out_stream.type_style(

[5/9] incubator-ariatosca git commit: ARIA-1 Parser test suite

2017-10-31 Thread emblemparade
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
--
diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
index 9bafeec..60d760a 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
@@ -88,7 +88,7 @@ def get_assigned_and_defined_parameter_values(context, 
presentation, field_name)
 definition = definitions[name]
 values[name] = coerce_parameter_value(context, value, 
definition, value.value)
 else:
-context.validation.report('assignment to undefined {0} "{1}" 
in "{2}"'
+context.validation.report(u'assignment to undefined {0} "{1}" 
in "{2}"'
   .format(field_name, name, 
presentation._fullname),
   locator=value._locator, 
level=Issue.BETWEEN_TYPES)
 
@@ -99,7 +99,7 @@ def get_assigned_and_defined_parameter_values(context, 
presentation, field_name)
 if (name not in values) and \
 (('default' in definition._raw) or (field_name == 
'attribute')):
 values[name] = coerce_parameter_value(context, presentation, 
definition,
-  definition.default)
+  definition.default, 
'default')
 
 validate_required_values(context, presentation, values, definitions)
 
@@ -147,11 +147,21 @@ def validate_required_values(context, presentation, 
values, definitions):
 
 if not definitions:
 return
+
+def has_value(name):
+if values is None:
+return False
+value = values.get(name)
+if value is None:
+return False
+if isinstance(value, Value) and (value.value is None):
+return False
+return True
+
 for name, definition in definitions.iteritems():
-if getattr(definition, 'required', False) and \
-((values is None) or (values.get(name) is None)):
-context.validation.report('required property "%s" is not assigned 
a value in "%s"'
-  % (name, presentation._fullname),
+if getattr(definition, 'required', False) and not has_value(name):
+context.validation.report(u'required property "{0}" is not 
assigned a value in "{1}"'
+  .format(name, presentation._fullname),
   
locator=presentation._get_child_locator('properties'),
   level=Issue.BETWEEN_TYPES)
 
@@ -166,14 +176,14 @@ def merge_raw_parameter_definition(context, presentation, 
raw_property_definitio
 our_property_definition._reset_method_cache()
 type2 = our_property_definition._get_type(context)
 
-if type1 != type2:
-if not hasattr(type1, '_is_descendant') or not 
type1._is_descendant(context, type2):
-context.validation.report(
-'property definition type "{0}" is not a descendant of 
overridden '
-'property definition type "{1}"' \
-.format(type1_name, type2._name),
-locator=presentation._get_child_locator(field_name, 
property_name),
-level=Issue.BETWEEN_TYPES)
+if (type1 is not type2) and \
+(not hasattr(type1, '_is_descendant') or not 
type1._is_descendant(context, type2)):
+context.validation.report(
+u'property definition type "{0}" is not a descendant of overridden 
'
+u'property definition type "{1}"' \
+.format(our_property_definition.type, type1_name),
+locator=presentation._get_child_locator(field_name, property_name),
+level=Issue.BETWEEN_TYPES)
 
 merge(raw_property_definition, our_property_definition._raw)
 
@@ -225,6 +235,5 @@ def coerce_parameter_value(context, presentation, 
definition, value, aspect=None
 def convert_parameter_definitions_to_values(context, definitions):
 values = OrderedDict()
 for name, definition in definitions.iteritems():
-default = definition.default
-values[name] = coerce_parameter_value(context, definition, definition, 
default)
+values[name] = coerce_parameter_value(context, definition, definition, 
definition.default)
 return values

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d233b238/extensions/aria_extension_tosca/simple_v1_0/modeling/requirements.py
--
diff --git 
a/extensions/aria_extension_tosca/simple_v1_0/modeling/requirements.py 
b/extensions/aria_extension_tosca/simple_v1_0/

[GitHub] incubator-ariatosca pull request #206: ARIA-405 Remove support for Python 2....

2017-10-31 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-ariatosca/pull/206


---


incubator-ariatosca git commit: ARIA-405 Remove support for Python 2.6

2017-10-31 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/master ae89ddb30 -> b1f03efce


ARIA-405 Remove support for Python 2.6

* setup.py now requires Python 2.7
* Upgrade all 3rd party libraries to recent versions
* API changes to networkx
* Stricter yaml.load call for ruamel.yaml
* Remove iter_modules implementation for Python 2.6
* Remove NullHander implementation for Python 2.6
* Remove "py26" tox test environments


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/b1f03efc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/b1f03efc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/b1f03efc

Branch: refs/heads/master
Commit: b1f03efcedd814f5fe38f051bfa0106cc715586f
Parents: ae89ddb
Author: Tal Liron 
Authored: Mon Oct 30 16:56:57 2017 -0500
Committer: Tal Liron 
Committed: Mon Oct 30 17:08:59 2017 -0500

--
 .travis.yml | 23 ++---
 Makefile|  8 ++--
 README.rst  |  7 +--
 appveyor.yml|  2 +-
 aria/__init__.py|  9 +---
 aria/cli/csar.py|  4 +-
 aria/cli/inputs.py  |  4 +-
 aria/logger.py  | 10 +---
 aria/orchestrator/workflows/api/task_graph.py   | 11 +++--
 aria/utils/imports.py   | 18 ---
 .../simple_v1_0/modeling/__init__.py|  2 +-
 requirements.in | 42 -
 requirements.txt| 28 +--
 setup.py| 15 +++---
 .../test_task_graph_into_execution_graph.py |  2 +-
 tests/requirements.txt  | 11 ++---
 tox.ini | 49 +---
 17 files changed, 80 insertions(+), 165 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b1f03efc/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 958be80..b264ab3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,19 +19,7 @@ sudo: true
 
 language: python
 
-addons:
-  apt:
-sources:
-  - sourceline: 'ppa:fkrull/deadsnakes'
-packages:
-  # Ubuntu 14.04 (trusty) does not come with Python 2.6, so we will 
install it from Felix
-  # Krull's PPA
-  - python2.6
-  - python2.6-dev
-
 python:
-  # We handle Python 2.6 testing from within tox (see tox.ini); note that this 
means that we run
-  # tox itself always from Python 2.7
   - '2.7'
 
 env:
@@ -39,14 +27,11 @@ env:
   # for PyTest's xdist plugin. The reason this is necessary is that 
conventional Travis environments
   # may report a large amount of available CPUs, but they they are greatly 
restricted. Through trial
   # and error we found that more than 1 process may result in failures.
-  - PYTEST_PROCESSES=1 TOX_ENV=pylint_code
+  - PYTEST_PROCESSES=1 TOX_ENV=pylint_core
   - PYTEST_PROCESSES=1 TOX_ENV=pylint_tests
-  - PYTEST_PROCESSES=1 TOX_ENV=py27
-  - PYTEST_PROCESSES=1 TOX_ENV=py26
-  - PYTEST_PROCESSES=1 TOX_ENV=py27e2e
-  - PYTEST_PROCESSES=1 TOX_ENV=py26e2e
-  - PYTEST_PROCESSES=1 TOX_ENV=py27ssh
-  - PYTEST_PROCESSES=1 TOX_ENV=py26ssh
+  - PYTEST_PROCESSES=1 TOX_ENV=core
+  - PYTEST_PROCESSES=1 TOX_ENV=e2e
+  - PYTEST_PROCESSES=1 TOX_ENV=ssh
   - PYTEST_PROCESSES=1 TOX_ENV=docs
 
 before_install:

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b1f03efc/Makefile
--
diff --git a/Makefile b/Makefile
index 9fef3ab..e68538e 100644
--- a/Makefile
+++ b/Makefile
@@ -51,11 +51,11 @@ docs:
 
 test:
pip install --upgrade "tox>=2.7.0"
-   tox -e pylint_code \
+   tox -e pylint_core \
-e pylint_tests \
-   -e py$(PYTHON_VERSION) \
-   -e py$(PYTHON_VERSION)e2e \
-   -e py$(PYTHON_VERSION)ssh \
+   -e core \
+   -e e2e \
+   -e ssh \
-e docs
 
 ./requirements.txt: ./requirements.in

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b1f03efc/README.rst
--
diff --git a/README.rst b/README.rst
index 1985f10..c905277 100644
--- a/README.rst
+++ b/README.rst
@@ -28,7 +28,7 @@ Installation
 
 ARIA is `available on PyPI `__.
 
-ARIA requires Python 2.6/2.7. Python 3 is currently not supported.
+ARIA requires Python 2.7. Python 3 is currently not supported.
 
 To install ARIA directly from PyPI (using a ``wheel``), use::
 
@@

incubator-ariatosca git commit: More fixes

2017-10-31 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-1-parser-test-suite f2e8cf883 -> 5792ac747


More fixes


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/5792ac74
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/5792ac74
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/5792ac74

Branch: refs/heads/ARIA-1-parser-test-suite
Commit: 5792ac7478014ef1dcf7d29a86a868f046224626
Parents: f2e8cf8
Author: Tal Liron 
Authored: Tue Oct 31 13:42:44 2017 -0500
Committer: Tal Liron 
Committed: Tue Oct 31 13:42:44 2017 -0500

--
 .../simple_v1_0/modeling/interfaces.py  | 25 +++-
 .../simple_v1_0/modeling/parameters.py  |  2 +-
 .../templates/common/test_template_interface.py |  7 --
 .../test_template_parameters_properties.py  | 20 +++-
 4 files changed, 24 insertions(+), 30 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5792ac74/extensions/aria_extension_tosca/simple_v1_0/modeling/interfaces.py
--
diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/interfaces.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/interfaces.py
index 7580ef3..af536c3 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/modeling/interfaces.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/interfaces.py
@@ -460,14 +460,21 @@ def merge_interface_definitions_from_their_types(context, 
interfaces, presentati
 merge_interface_definition(context, interface, the_type, 
presentation, 'type')
 
 
-def assign_raw_inputs(context, values, assignments, definitions, 
interface_name, operation_name,
+def assign_raw_inputs(context, raw, assignments, definitions, interface_name, 
operation_name,
   presentation):
-if not assignments:
-return
+if assignments is None:
+assignments = {}
 
 # Make sure we have the dict
-if ('inputs' not in values) or (values['inputs'] is None):
-values['inputs'] = OrderedDict()
+if ('inputs' not in raw) or (raw['inputs'] is None):
+raw['inputs'] = OrderedDict()
+
+# Defaults
+if definitions:
+for input_name, definition in definitions.iteritems():
+if ('default' in definition._raw) and (input_name not in 
raw['inputs']):
+raw['inputs'][input_name] = coerce_parameter_value(context, 
definition, definition,
+   
definition.default, 'default')
 
 # Assign inputs
 for input_name, assignment in assignments.iteritems():
@@ -485,12 +492,8 @@ def assign_raw_inputs(context, values, assignments, 
definitions, interface_name,
 locator=assignment._locator, level=Issue.BETWEEN_TYPES)
 
 definition = definitions.get(input_name) if definitions is not None 
else None
-
-# Note: default value has already been assigned
-
-# Coerce value
-values['inputs'][input_name] = coerce_parameter_value(context, 
assignment, definition,
-  assignment.value)
+raw['inputs'][input_name] = coerce_parameter_value(context, 
assignment, definition,
+   assignment.value)
 
 
 def validate_required_inputs(context, presentation, assignment, definition, 
original_assignment,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5792ac74/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
--
diff --git a/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py 
b/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
index c3a1800..60d760a 100644
--- a/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
+++ b/extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py
@@ -99,7 +99,7 @@ def get_assigned_and_defined_parameter_values(context, 
presentation, field_name)
 if (name not in values) and \
 (('default' in definition._raw) or (field_name == 
'attribute')):
 values[name] = coerce_parameter_value(context, presentation, 
definition,
-  definition.default)
+  definition.default, 
'default')
 
 validate_required_values(context, presentation, values, definitions)
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5792ac74/tests/extensions/aria_extension_tosca/simple_v1_0/templates/common/test_template_interface.py
--