[jira] [Resolved] (ARIA-230) Dry execution doesn't log empty operations

2017-05-08 Thread Maxim Orlov (JIRA)

 [ 
https://issues.apache.org/jira/browse/ARIA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maxim Orlov resolved ARIA-230.
--
   Resolution: Fixed
Fix Version/s: 0.1.0

> Dry execution doesn't log empty operations
> --
>
> Key: ARIA-230
> URL: https://issues.apache.org/jira/browse/ARIA-230
> Project: AriaTosca
>  Issue Type: Bug
>Affects Versions: 0.1.0
>Reporter: Maxim Orlov
>Assignee: Maxim Orlov
> Fix For: 0.1.0
>
>
> Dry execution doesn't log empty operations



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-165) Make node name suffix UUIDs become more readable

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002029#comment-16002029
 ] 

ASF subversion and git services commented on ARIA-165:
--

Commit 69531fd24dd16c80184e17690770b373d59fcdc7 in incubator-ariatosca's branch 
refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable from 
[~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=69531fd ]

ARIA-165 Make node name suffix UUIDs become more readable


> Make node name suffix UUIDs become more readable
> 
>
> Key: ARIA-165
> URL: https://issues.apache.org/jira/browse/ARIA-165
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
>
> Node names are currently constructed of the node template name with a UUID 
> suffix. While this makes the node name unique across all services, it also 
> makes the node names less readable, and since nodes are already unique via 
> their ID, it might be better to use a different type of suffix.
> One option would be to generate a shorter, no capital letters string, which 
> would be more readable, and (in very high probability) unique in a single 
> service.
> Another option would be to go for a running number suffix for each node of a 
> given node template, which could be simple, unique and readable.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-230) Dry execution doesn't log empty operations

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002025#comment-16002025
 ] 

ASF subversion and git services commented on ARIA-230:
--

Commit b11fbc946ae6d26ad6c70a283cc6d6501c320273 in incubator-ariatosca's branch 
refs/heads/ARIA-160-Tests-fail-spordically-over-parameter-binding from [~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=b11fbc9 ]

ARIA-230 Dry execution doesn't log empty operations


> Dry execution doesn't log empty operations
> --
>
> Key: ARIA-230
> URL: https://issues.apache.org/jira/browse/ARIA-230
> Project: AriaTosca
>  Issue Type: Bug
>Affects Versions: 0.1.0
>Reporter: Maxim Orlov
>Assignee: Maxim Orlov
>
> Dry execution doesn't log empty operations



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-160) Operation toolbelt unit tests fail spordically

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002026#comment-16002026
 ] 

ASF subversion and git services commented on ARIA-160:
--

Commit 3fdfaccfa0e4a61237ee5b221536eca6f2906ec4 in incubator-ariatosca's branch 
refs/heads/ARIA-160-Tests-fail-spordically-over-parameter-binding from [~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=3fdfacc ]

ARIA-160 Tests fail spordically over parameter binding


> Operation toolbelt unit tests fail spordically
> --
>
> Key: ARIA-160
> URL: https://issues.apache.org/jira/browse/ARIA-160
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
> Fix For: 0.1.0
>
>
> The unit tests in the module {{test_toolbelt.py}} fail remote builds 
> (TravisCI, Jenkins) sporadically.
> Stack trace:
> {code}
> workflow_context = WorkflowContext(deployment_id=1, 
> workflow_name=test_workflow, execution_id=1)
> executor =  at 0x7f57f8482a50>
> def test_host_ip(workflow_context, executor):
> interface_name = 'Standard'
> operation_name = 'create'
> _, dependency_node, _, _, _ = _get_elements(workflow_context)
> inputs = {'putput': True}
> interface = mock.models.create_interface(
> dependency_node.service,
> interface_name=interface_name,
> operation_name=operation_name,
> operation_kwargs=dict(implementation=op_path(host_ip, 
> module_path=__name__),
>   inputs=inputs)
> )
> dependency_node.interfaces[interface.name] = interface
> workflow_context.model.node.update(dependency_node)
> 
> @workflow
> def basic_workflow(graph, **_):
> graph.add_tasks(
> api.task.OperationTask.for_node(
> node=dependency_node,
> interface_name=interface_name,
> operation_name=operation_name,
> inputs=inputs
> )
> )
> 
> >   execute(workflow_func=basic_workflow, 
> > workflow_context=workflow_context, executor=executor)
> tests/orchestrator/context/test_toolbelt.py:101: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> tests/orchestrator/context/__init__.py:29: in execute
> eng.execute()
> aria/orchestrator/workflows/core/engine.py:59: in execute
> for task in self._ended_tasks():
> aria/orchestrator/workflows/core/engine.py:96: in 
> return (task for task in self._tasks_iter() if task.has_ended())
> aria/orchestrator/workflows/core/task.py:259: in __getattr__
> return getattr(self.model_task, attr)
> aria/orchestrator/workflows/core/task.py:178: in model_task
> return self._workflow_context.model.task.get(self._task_id)
> aria/storage/sql_mapi.py:59: in get
> result = query.first()
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2731: in first
> ret = list(self[0:1])
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2523: in 
> __getitem__
> return list(res)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2831: in 
> __iter__
> return self._execute_and_instances(context)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2854: in 
> _execute_and_instances
> result = conn.execute(querycontext.statement, self._params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:945: in 
> execute
> return meth(self, multiparams, params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/sql/elements.py:263: in 
> _execute_on_connection
> return connection._execute_clauseelement(self, multiparams, params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1053: in 
> _execute_clauseelement
> compiled_sql, distilled_params
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1189: in 
> _execute_context
> context)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1393: in 
> _handle_dbapi_exception
> exc_info
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/util/compat.py:203: in 
> raise_from_cause
> reraise(type(exception), exception, tb=exc_tb, cause=cause)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1182: in 
> _execute_context
> context)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> self =  0x7f57f97ee250>
> cursor = 
> statement = 'SELECT task.id AS task_id, task.name AS task_name, 
> task.implementation AS task_implementation, task.max_attempts AS t..._fk AS 
> task_execution_fk, task.relationship_fk AS task_relationship_fk 
> FROM task 
> WHERE task.id = ?
>  LIMIT ? OFFSET ?'

[jira] [Commented] (ARIA-230) Dry execution doesn't log empty operations

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002028#comment-16002028
 ] 

ASF subversion and git services commented on ARIA-230:
--

Commit b11fbc946ae6d26ad6c70a283cc6d6501c320273 in incubator-ariatosca's branch 
refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable from 
[~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=b11fbc9 ]

ARIA-230 Dry execution doesn't log empty operations


> Dry execution doesn't log empty operations
> --
>
> Key: ARIA-230
> URL: https://issues.apache.org/jira/browse/ARIA-230
> Project: AriaTosca
>  Issue Type: Bug
>Affects Versions: 0.1.0
>Reporter: Maxim Orlov
>Assignee: Maxim Orlov
>
> Dry execution doesn't log empty operations



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[2/2] incubator-ariatosca git commit: ARIA-160 Tests fail spordically over parameter binding

2017-05-08 Thread mxmrlv
ARIA-160 Tests fail spordically over parameter binding


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

Branch: refs/heads/ARIA-160-Tests-fail-spordically-over-parameter-binding
Commit: 3fdfaccfa0e4a61237ee5b221536eca6f2906ec4
Parents: b11fbc9
Author: max-orlov 
Authored: Mon May 8 14:46:58 2017 +0300
Committer: max-orlov 
Committed: Tue May 9 07:52:11 2017 +0300

--
 aria/orchestrator/workflows/core/engine.py   |   3 +-
 tests/helpers.py |  19 ++--
 tests/orchestrator/context/test_operation.py | 107 --
 tests/orchestrator/context/test_toolbelt.py  |  38 
 4 files changed, 87 insertions(+), 80 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3fdfaccf/aria/orchestrator/workflows/core/engine.py
--
diff --git a/aria/orchestrator/workflows/core/engine.py 
b/aria/orchestrator/workflows/core/engine.py
index fd0dd6d..561265c 100644
--- a/aria/orchestrator/workflows/core/engine.py
+++ b/aria/orchestrator/workflows/core/engine.py
@@ -42,10 +42,9 @@ class Engine(logger.LoggerMixin):
 super(Engine, self).__init__(**kwargs)
 self._workflow_context = workflow_context
 self._execution_graph = networkx.DiGraph()
-self._executor = executor
 translation.build_execution_graph(task_graph=tasks_graph,
   
execution_graph=self._execution_graph,
-  default_executor=self._executor)
+  default_executor=executor)
 
 def execute(self):
 """

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3fdfaccf/tests/helpers.py
--
diff --git a/tests/helpers.py b/tests/helpers.py
index 423e63f..5f9bd9a 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -14,7 +14,6 @@
 # limitations under the License.
 
 import os
-import tempfile
 import json
 
 from . import ROOT_DIR
@@ -34,16 +33,17 @@ def get_service_template_uri(*args):
 
 
 class FilesystemDataHolder(object):
-_tmpfile = tempfile.NamedTemporaryFile('w')
 
 def _load(self):
-return json.load(open(self._tmpfile.name))
+return json.load(open(self._path))
 
 def _dump(self, value):
-return json.dump(value, open(self._tmpfile.name, 'w'))
+return json.dump(value, open(self._path, 'w'))
 
-def __init__(self):
-self.clear()
+def __init__(self, path, reset=False):
+self._path = path
+if reset or not os.path.exists(self._path) or open(self._path).read() 
== '':
+self._dump({})
 
 def __setitem__(self, key, value):
 dict_ = self._load()
@@ -56,9 +56,6 @@ class FilesystemDataHolder(object):
 def __iter__(self):
 return iter(self._load())
 
-def clear(self):
-self._dump({})
-
 def get(self, item, default=None):
 return self._load().get(item, default)
 
@@ -67,3 +64,7 @@ class FilesystemDataHolder(object):
 return_value = dict_.setdefault(key, value)
 self._dump(dict_)
 return return_value
+
+@property
+def path(self):
+return self._path

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3fdfaccf/tests/orchestrator/context/test_operation.py
--
diff --git a/tests/orchestrator/context/test_operation.py 
b/tests/orchestrator/context/test_operation.py
index 3180d89..9f70956 100644
--- a/tests/orchestrator/context/test_operation.py
+++ b/tests/orchestrator/context/test_operation.py
@@ -38,7 +38,6 @@ from . import (
 execute,
 )
 
-global_test_holder = helpers.FilesystemDataHolder()
 
 @pytest.fixture
 def ctx(tmpdir):
@@ -68,11 +67,18 @@ def thread_executor():
 ex.close()
 
 
-def test_node_operation_task_execution(ctx, thread_executor):
+@pytest.fixture
+def test_holder(tmpdir):
+test_holder_path = str(tmpdir.join('test_holder'))
+holder = helpers.FilesystemDataHolder(test_holder_path)
+return holder
+
+
+def test_node_operation_task_execution(ctx, thread_executor, test_holder):
 interface_name = 'Standard'
 operation_name = 'create'
 
-inputs = {'putput': True}
+inputs = {'putput': True, 'holder_path': test_holder.path}
 node = ctx.model.node.get_by_name(mock.models.DEPENDENCY_NODE_NAME)
 interface = mock.models.create_interface(
 node.service,
@@ 

[jira] [Commented] (ARIA-230) Dry execution doesn't log empty operations

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002022#comment-16002022
 ] 

ASF GitHub Bot commented on ARIA-230:
-

Github user asfgit closed the pull request at:

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


> Dry execution doesn't log empty operations
> --
>
> Key: ARIA-230
> URL: https://issues.apache.org/jira/browse/ARIA-230
> Project: AriaTosca
>  Issue Type: Bug
>Affects Versions: 0.1.0
>Reporter: Maxim Orlov
>Assignee: Maxim Orlov
>
> Dry execution doesn't log empty operations



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-230) Dry execution doesn't log empty operations

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16002021#comment-16002021
 ] 

ASF subversion and git services commented on ARIA-230:
--

Commit b11fbc946ae6d26ad6c70a283cc6d6501c320273 in incubator-ariatosca's branch 
refs/heads/master from [~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=b11fbc9 ]

ARIA-230 Dry execution doesn't log empty operations


> Dry execution doesn't log empty operations
> --
>
> Key: ARIA-230
> URL: https://issues.apache.org/jira/browse/ARIA-230
> Project: AriaTosca
>  Issue Type: Bug
>Affects Versions: 0.1.0
>Reporter: Maxim Orlov
>Assignee: Maxim Orlov
>
> Dry execution doesn't log empty operations



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[incubator-ariatosca] Git Push Summary

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-230-Dry-execution-doesnt-log-empty-operations [deleted] 
b11fbc946


[GitHub] incubator-ariatosca pull request #127: ARIA-230 Dry execution doesn't log em...

2017-05-08 Thread asfgit
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


incubator-ariatosca git commit: ARIA-230 Dry execution doesn't log empty operations

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/master 0ec237071 -> b11fbc946


ARIA-230 Dry execution doesn't log empty operations


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

Branch: refs/heads/master
Commit: b11fbc946ae6d26ad6c70a283cc6d6501c320273
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 17:29:29 2017 +0300
Committer: max-orlov 
Committed: Tue May 9 01:02:46 2017 +0300

--
 aria/orchestrator/workflows/executor/dry.py | 26 
 1 file changed, 13 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b11fbc94/aria/orchestrator/workflows/executor/dry.py
--
diff --git a/aria/orchestrator/workflows/executor/dry.py 
b/aria/orchestrator/workflows/executor/dry.py
index f6fb7a6..63ec392 100644
--- a/aria/orchestrator/workflows/executor/dry.py
+++ b/aria/orchestrator/workflows/executor/dry.py
@@ -32,20 +32,20 @@ class DryExecutor(BaseExecutor):
 task.started_at = datetime.utcnow()
 task.status = task.STARTED
 
+dry_msg = ' {name} {task.interface_name}.{task.operation_name} 
{suffix}'
+logger = task.context.logger.info if task.implementation else 
task.context.logger.debug
+
+if hasattr(task.actor, 'source_node'):
+name = '{source_node.name}->{target_node.name}'.format(
+source_node=task.actor.source_node, 
target_node=task.actor.target_node)
+else:
+name = task.actor.name
+
 if task.implementation:
-if hasattr(task.actor, 'source_node'):
-name = '{source_node.name}->{target_node.name}'.format(
-source_node=task.actor.source_node, 
target_node=task.actor.target_node)
-else:
-name = task.actor.name
-
-task.context.logger.info(
-' {name} {task.interface_name}.{task.operation_name} 
started...'
-.format(name=name, task=task))
-
-task.context.logger.info(
-' {name} {task.interface_name}.{task.operation_name} 
successful'
-.format(name=name, task=task))
+logger(dry_msg.format(name=name, task=task, suffix='started...'))
+logger(dry_msg.format(name=name, task=task, suffix='successful'))
+else:
+logger(dry_msg.format(name=name, task=task, suffix='has no 
implementation'))
 
 # updating the task manually instead of calling 
self._task_succeeded(task),
 # to avoid any side effects raising that event might cause



[jira] [Commented] (ARIA-160) Operation toolbelt unit tests fail spordically

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001642#comment-16001642
 ] 

ASF subversion and git services commented on ARIA-160:
--

Commit 0532c8074ad66d0ab5052c3773dacfa069c61363 in incubator-ariatosca's branch 
refs/heads/ARIA-160-Tests-fail-spordically-over-parameter-binding from [~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=0532c80 ]

ARIA-160 Tests fail spordically over parameter binding


> Operation toolbelt unit tests fail spordically
> --
>
> Key: ARIA-160
> URL: https://issues.apache.org/jira/browse/ARIA-160
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
> Fix For: 0.1.0
>
>
> The unit tests in the module {{test_toolbelt.py}} fail remote builds 
> (TravisCI, Jenkins) sporadically.
> Stack trace:
> {code}
> workflow_context = WorkflowContext(deployment_id=1, 
> workflow_name=test_workflow, execution_id=1)
> executor =  at 0x7f57f8482a50>
> def test_host_ip(workflow_context, executor):
> interface_name = 'Standard'
> operation_name = 'create'
> _, dependency_node, _, _, _ = _get_elements(workflow_context)
> inputs = {'putput': True}
> interface = mock.models.create_interface(
> dependency_node.service,
> interface_name=interface_name,
> operation_name=operation_name,
> operation_kwargs=dict(implementation=op_path(host_ip, 
> module_path=__name__),
>   inputs=inputs)
> )
> dependency_node.interfaces[interface.name] = interface
> workflow_context.model.node.update(dependency_node)
> 
> @workflow
> def basic_workflow(graph, **_):
> graph.add_tasks(
> api.task.OperationTask.for_node(
> node=dependency_node,
> interface_name=interface_name,
> operation_name=operation_name,
> inputs=inputs
> )
> )
> 
> >   execute(workflow_func=basic_workflow, 
> > workflow_context=workflow_context, executor=executor)
> tests/orchestrator/context/test_toolbelt.py:101: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> tests/orchestrator/context/__init__.py:29: in execute
> eng.execute()
> aria/orchestrator/workflows/core/engine.py:59: in execute
> for task in self._ended_tasks():
> aria/orchestrator/workflows/core/engine.py:96: in 
> return (task for task in self._tasks_iter() if task.has_ended())
> aria/orchestrator/workflows/core/task.py:259: in __getattr__
> return getattr(self.model_task, attr)
> aria/orchestrator/workflows/core/task.py:178: in model_task
> return self._workflow_context.model.task.get(self._task_id)
> aria/storage/sql_mapi.py:59: in get
> result = query.first()
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2731: in first
> ret = list(self[0:1])
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2523: in 
> __getitem__
> return list(res)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2831: in 
> __iter__
> return self._execute_and_instances(context)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2854: in 
> _execute_and_instances
> result = conn.execute(querycontext.statement, self._params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:945: in 
> execute
> return meth(self, multiparams, params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/sql/elements.py:263: in 
> _execute_on_connection
> return connection._execute_clauseelement(self, multiparams, params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1053: in 
> _execute_clauseelement
> compiled_sql, distilled_params
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1189: in 
> _execute_context
> context)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1393: in 
> _handle_dbapi_exception
> exc_info
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/util/compat.py:203: in 
> raise_from_cause
> reraise(type(exception), exception, tb=exc_tb, cause=cause)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1182: in 
> _execute_context
> context)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> self =  0x7f57f97ee250>
> cursor = 
> statement = 'SELECT task.id AS task_id, task.name AS task_name, 
> task.implementation AS task_implementation, task.max_attempts AS t..._fk AS 
> task_execution_fk, task.relationship_fk AS task_relationship_fk 
> FROM task 
> WHERE task.id = ?
>  LIMIT ? OFFSET ?'

incubator-ariatosca git commit: ARIA-160 Tests fail spordically over parameter binding [Forced Update!]

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-160-Tests-fail-spordically-over-parameter-binding fdcddc85c 
-> 0532c8074 (forced update)


ARIA-160 Tests fail spordically over parameter binding


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

Branch: refs/heads/ARIA-160-Tests-fail-spordically-over-parameter-binding
Commit: 0532c8074ad66d0ab5052c3773dacfa069c61363
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 14:46:58 2017 +0300
Committer: max-orlov 
Committed: Tue May 9 01:03:47 2017 +0300

--
 aria/orchestrator/workflows/core/engine.py   |   3 +-
 tests/helpers.py |  19 ++--
 tests/orchestrator/context/test_operation.py | 107 --
 tests/orchestrator/context/test_toolbelt.py  |  38 
 4 files changed, 87 insertions(+), 80 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/0532c807/aria/orchestrator/workflows/core/engine.py
--
diff --git a/aria/orchestrator/workflows/core/engine.py 
b/aria/orchestrator/workflows/core/engine.py
index fd0dd6d..561265c 100644
--- a/aria/orchestrator/workflows/core/engine.py
+++ b/aria/orchestrator/workflows/core/engine.py
@@ -42,10 +42,9 @@ class Engine(logger.LoggerMixin):
 super(Engine, self).__init__(**kwargs)
 self._workflow_context = workflow_context
 self._execution_graph = networkx.DiGraph()
-self._executor = executor
 translation.build_execution_graph(task_graph=tasks_graph,
   
execution_graph=self._execution_graph,
-  default_executor=self._executor)
+  default_executor=executor)
 
 def execute(self):
 """

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/0532c807/tests/helpers.py
--
diff --git a/tests/helpers.py b/tests/helpers.py
index 423e63f..6dad4fa 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -14,7 +14,6 @@
 # limitations under the License.
 
 import os
-import tempfile
 import json
 
 from . import ROOT_DIR
@@ -34,16 +33,17 @@ def get_service_template_uri(*args):
 
 
 class FilesystemDataHolder(object):
-_tmpfile = tempfile.NamedTemporaryFile('w')
 
 def _load(self):
-return json.load(open(self._tmpfile.name))
+return json.load(open(self._path))
 
 def _dump(self, value):
-return json.dump(value, open(self._tmpfile.name, 'w'))
+return json.dump(value, open(self._path, 'w'))
 
-def __init__(self):
-self.clear()
+def __init__(self, path, reset=False):
+self._path = path
+if reset or not os.path.exists(self._path) or open(self._path).read() 
== '':
+self._dump({})
 
 def __setitem__(self, key, value):
 dict_ = self._load()
@@ -56,9 +56,6 @@ class FilesystemDataHolder(object):
 def __iter__(self):
 return iter(self._load())
 
-def clear(self):
-self._dump({})
-
 def get(self, item, default=None):
 return self._load().get(item, default)
 
@@ -67,3 +64,7 @@ class FilesystemDataHolder(object):
 return_value = dict_.setdefault(key, value)
 self._dump(dict_)
 return return_value
+
+@property
+def path(self):
+return self._path
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/0532c807/tests/orchestrator/context/test_operation.py
--
diff --git a/tests/orchestrator/context/test_operation.py 
b/tests/orchestrator/context/test_operation.py
index 3180d89..9f70956 100644
--- a/tests/orchestrator/context/test_operation.py
+++ b/tests/orchestrator/context/test_operation.py
@@ -38,7 +38,6 @@ from . import (
 execute,
 )
 
-global_test_holder = helpers.FilesystemDataHolder()
 
 @pytest.fixture
 def ctx(tmpdir):
@@ -68,11 +67,18 @@ def thread_executor():
 ex.close()
 
 
-def test_node_operation_task_execution(ctx, thread_executor):
+@pytest.fixture
+def test_holder(tmpdir):
+test_holder_path = str(tmpdir.join('test_holder'))
+holder = helpers.FilesystemDataHolder(test_holder_path)
+return holder
+
+
+def test_node_operation_task_execution(ctx, thread_executor, test_holder):
 interface_name = 'Standard'
 operation_name = 'create'
 
-inputs = {'putput': True}
+inputs = 

[jira] [Commented] (ARIA-165) Make node name suffix UUIDs become more readable

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001637#comment-16001637
 ] 

ASF subversion and git services commented on ARIA-165:
--

Commit 4c3050e00556df82a2798d5f8bf91a4a0d949d32 in incubator-ariatosca's branch 
refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable from 
[~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=4c3050e ]

ARIA-165 Make node name suffix UUIDs become more readable


> Make node name suffix UUIDs become more readable
> 
>
> Key: ARIA-165
> URL: https://issues.apache.org/jira/browse/ARIA-165
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
>
> Node names are currently constructed of the node template name with a UUID 
> suffix. While this makes the node name unique across all services, it also 
> makes the node names less readable, and since nodes are already unique via 
> their ID, it might be better to use a different type of suffix.
> One option would be to generate a shorter, no capital letters string, which 
> would be more readable, and (in very high probability) unique in a single 
> service.
> Another option would be to go for a running number suffix for each node of a 
> given node template, which could be simple, unique and readable.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-230) Dry execution doesn't log empty operations

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001640#comment-16001640
 ] 

ASF subversion and git services commented on ARIA-230:
--

Commit b11fbc946ae6d26ad6c70a283cc6d6501c320273 in incubator-ariatosca's branch 
refs/heads/ARIA-230-Dry-execution-doesnt-log-empty-operations from [~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=b11fbc9 ]

ARIA-230 Dry execution doesn't log empty operations


> Dry execution doesn't log empty operations
> --
>
> Key: ARIA-230
> URL: https://issues.apache.org/jira/browse/ARIA-230
> Project: AriaTosca
>  Issue Type: Bug
>Affects Versions: 0.1.0
>Reporter: Maxim Orlov
>Assignee: Maxim Orlov
>
> Dry execution doesn't log empty operations



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


incubator-ariatosca git commit: ARIA-165 Make node name suffix UUIDs become more readable [Forced Update!]

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable 
cfe8e546c -> 4c3050e00 (forced update)


ARIA-165 Make node name suffix UUIDs become more readable


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

Branch: refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable
Commit: 4c3050e00556df82a2798d5f8bf91a4a0d949d32
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 15:25:37 2017 +0300
Committer: max-orlov 
Committed: Tue May 9 01:02:11 2017 +0300

--
 aria/modeling/service_template.py | 8 ++--
 aria/parser/modeling/context.py   | 5 -
 2 files changed, 6 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4c3050e0/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7fab4fc..0050f4a 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -549,9 +549,13 @@ class NodeTemplateBase(TemplateModelMixin):
 ('requirement_templates', 
formatting.as_raw_list(self.requirement_templates
 
 def instantiate(self, container):
-context = ConsumptionContext.get_thread_local()
 from . import models
-name = context.modeling.generate_node_id(self.name)
+if self.nodes:
+latest_node_index = self.nodes[-1].name.rsplit('_', 1)[1]
+index = int(latest_node_index) + 1
+else:
+index = 0
+name = '{name}_{index}'.format(name=self.name, index=index)
 node = models.Node(name=name,
type=self.type,

description=deepcopy_with_locators(self.description),

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4c3050e0/aria/parser/modeling/context.py
--
diff --git a/aria/parser/modeling/context.py b/aria/parser/modeling/context.py
index dff5991..4a53641 100644
--- a/aria/parser/modeling/context.py
+++ b/aria/parser/modeling/context.py
@@ -67,11 +67,6 @@ class ModelingContext(object):
 if self.instance is not None:
 model_storage.service.put(self.instance)
 
-def generate_node_id(self, template_name):
-return self.node_id_format.format(
-template=template_name,
-id=self.generate_id())
-
 def generate_id(self):
 if self.id_type == IdType.LOCAL_SERIAL:
 return self._serial_id_counter.next()



[jira] [Commented] (ARIA-165) Make node name suffix UUIDs become more readable

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001626#comment-16001626
 ] 

ASF subversion and git services commented on ARIA-165:
--

Commit cfe8e546c4494f68a5ec13f1d7becbf962d140c0 in incubator-ariatosca's branch 
refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable from 
[~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=cfe8e54 ]

ARIA-165 Make node name suffix UUIDs become more readable


> Make node name suffix UUIDs become more readable
> 
>
> Key: ARIA-165
> URL: https://issues.apache.org/jira/browse/ARIA-165
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
>
> Node names are currently constructed of the node template name with a UUID 
> suffix. While this makes the node name unique across all services, it also 
> makes the node names less readable, and since nodes are already unique via 
> their ID, it might be better to use a different type of suffix.
> One option would be to generate a shorter, no capital letters string, which 
> would be more readable, and (in very high probability) unique in a single 
> service.
> Another option would be to go for a running number suffix for each node of a 
> given node template, which could be simple, unique and readable.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


incubator-ariatosca git commit: ARIA-165 Make node name suffix UUIDs become more readable [Forced Update!]

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable 
6c25143c1 -> cfe8e546c (forced update)


ARIA-165 Make node name suffix UUIDs become more readable


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

Branch: refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable
Commit: cfe8e546c4494f68a5ec13f1d7becbf962d140c0
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 15:25:37 2017 +0300
Committer: max-orlov 
Committed: Tue May 9 00:56:23 2017 +0300

--
 aria/modeling/service_template.py | 10 +++---
 aria/parser/modeling/context.py   |  5 -
 2 files changed, 7 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/cfe8e546/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7fab4fc..bf7b383 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -306,7 +306,7 @@ class ServiceTemplateBase(TemplateModelMixin):
 utils.instantiate_dict(self, service.meta_data, self.meta_data)
 
 for node_template in self.node_templates.itervalues():
-for _ in range(node_template.default_instances):
+for _ in range(2):
 node = node_template.instantiate(container)
 service.nodes[node.name] = node
 
@@ -549,9 +549,13 @@ class NodeTemplateBase(TemplateModelMixin):
 ('requirement_templates', 
formatting.as_raw_list(self.requirement_templates
 
 def instantiate(self, container):
-context = ConsumptionContext.get_thread_local()
 from . import models
-name = context.modeling.generate_node_id(self.name)
+if self.nodes:
+latest_node_index = self.nodes[-1].name.rsplit('_', 1)[1]
+index = int(latest_node_index) + 1
+else:
+index = 0
+name = '{name}_{index}'.format(name=self.name, index=index)
 node = models.Node(name=name,
type=self.type,

description=deepcopy_with_locators(self.description),

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/cfe8e546/aria/parser/modeling/context.py
--
diff --git a/aria/parser/modeling/context.py b/aria/parser/modeling/context.py
index dff5991..4a53641 100644
--- a/aria/parser/modeling/context.py
+++ b/aria/parser/modeling/context.py
@@ -67,11 +67,6 @@ class ModelingContext(object):
 if self.instance is not None:
 model_storage.service.put(self.instance)
 
-def generate_node_id(self, template_name):
-return self.node_id_format.format(
-template=template_name,
-id=self.generate_id())
-
 def generate_id(self):
 if self.id_type == IdType.LOCAL_SERIAL:
 return self._serial_id_counter.next()



[jira] [Updated] (ARIA-231) Parser does not show validation error if the same section appears twice

2017-05-08 Thread Tal Liron (JIRA)

 [ 
https://issues.apache.org/jira/browse/ARIA-231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tal Liron updated ARIA-231:
---
Description: 
Investigate what happens when a YAML section appears twice, e.g.:
{code}
node_templates:
  my_template:
requirements:
  ...
requirements:
  ...
{code}
There are currently no errors for this. :/

One would imagine that it's illegal YAML for a dict key to appear twice, and 
that the YAML parser should fail. If it's indeed a YAML parser bug, it might 
difficult to detect...

  was:
Investigate what happens when a YAML section appears twice, e.g.:
{code}
node_templates:
  my_template:
requirements:
  ...
requirements:
  ...
{code}
One would imagine that it's illegal YAML for a dict key to appear twice, and 
that the YAML parser should fail. If it's indeed a YAML parser bug, it might 
difficult to detect...


> Parser does not show validation error if the same section appears twice
> ---
>
> Key: ARIA-231
> URL: https://issues.apache.org/jira/browse/ARIA-231
> Project: AriaTosca
>  Issue Type: Task
>Reporter: Tal Liron
>Priority: Minor
>
> Investigate what happens when a YAML section appears twice, e.g.:
> {code}
> node_templates:
>   my_template:
> requirements:
>   ...
> requirements:
>   ...
> {code}
> There are currently no errors for this. :/
> One would imagine that it's illegal YAML for a dict key to appear twice, and 
> that the YAML parser should fail. If it's indeed a YAML parser bug, it might 
> difficult to detect...



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Updated] (ARIA-231) Parser does not show validation error if the same section appears twice

2017-05-08 Thread Tal Liron (JIRA)

 [ 
https://issues.apache.org/jira/browse/ARIA-231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tal Liron updated ARIA-231:
---
Priority: Minor  (was: Major)

> Parser does not show validation error if the same section appears twice
> ---
>
> Key: ARIA-231
> URL: https://issues.apache.org/jira/browse/ARIA-231
> Project: AriaTosca
>  Issue Type: Task
>Reporter: Tal Liron
>Priority: Minor
>
> Investigate what happens when a YAML section appears twice, e.g.:
> {code}
> node_templates:
>   my_template:
> requirements:
>   ...
> requirements:
>   ...
> {code}
> One would imagine that it's illegal YAML for a dict key to appear twice, and 
> that the YAML parser should fail. If it's indeed a YAML parser bug, it might 
> difficult to detect...



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Created] (ARIA-231) Parser does not validation error if the same section appears twice

2017-05-08 Thread Tal Liron (JIRA)
Tal Liron created ARIA-231:
--

 Summary: Parser does not validation error if the same section 
appears twice
 Key: ARIA-231
 URL: https://issues.apache.org/jira/browse/ARIA-231
 Project: AriaTosca
  Issue Type: Task
Reporter: Tal Liron


Investigate what happens when a YAML section appears twice, e.g.:
{code}
node_templates:
  my_template:
requirements:
  ...
requirements:
  ...
{code}
One would imagine that it's illegal YAML for a dict key to appear twice, and 
that the YAML parser should fail. If it's indeed a YAML parser bug, it might 
difficult to detect...



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-210) Relative paths may cause issues in `aria service-templates` commands

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001336#comment-16001336
 ] 

ASF GitHub Bot commented on ARIA-210:
-

Github user ran-z commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/128#discussion_r115324450
  
--- Diff: aria/cli/commands/service_templates.py ---
@@ -195,7 +195,9 @@ def create_archive(service_template_path, destination, 
logger):
 `destination` is the path of the output CSAR archive file
 """
 logger.info('Creating a CSAR archive')
-csar.write(os.path.dirname(service_template_path), 
service_template_path, destination, logger)
+if not destination.endswith('.csar'):
--- End diff --

maybe extract `.csar` suffix to a constant in csar.py? seems like its 
defined in several places now


> Relative paths may cause issues in `aria service-templates` commands
> 
>
> Key: ARIA-210
> URL: https://issues.apache.org/jira/browse/ARIA-210
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Avia Efrat
>
> The CLI commands {{aria service-templates store}} and {{aria 
> service-templates create-archive}} use the {{os.path.dirname}} method to get 
> the directory of the main service-template file.
> In the former ({{store}} command) this causes errors when the user is already 
> in the directory of the main service-template file and passes the file 
> directly (e.g. {{aria service-templates store service-template.yaml 
> my-service-template}})) - It'll fail when trying to copy the 
> service-template's resources like so:
> {{cannot copy tree '': not a directory}}
> In the latter ({{create-archive}}), any relative path usage will result in an 
> error claiming the file does not exist.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-210) Relative paths may cause issues in `aria service-templates` commands

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001338#comment-16001338
 ] 

ASF GitHub Bot commented on ARIA-210:
-

Github user ran-z commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/128#discussion_r115325816
  
--- Diff: aria/cli/service_template_utils.py ---
@@ -53,7 +53,7 @@ def get(source, service_template_filename):
 return _get_service_template_file_from_archive(source, 
service_template_filename)
--- End diff --

What about adding a short test or two for these scenarios? :)


> Relative paths may cause issues in `aria service-templates` commands
> 
>
> Key: ARIA-210
> URL: https://issues.apache.org/jira/browse/ARIA-210
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Avia Efrat
>
> The CLI commands {{aria service-templates store}} and {{aria 
> service-templates create-archive}} use the {{os.path.dirname}} method to get 
> the directory of the main service-template file.
> In the former ({{store}} command) this causes errors when the user is already 
> in the directory of the main service-template file and passes the file 
> directly (e.g. {{aria service-templates store service-template.yaml 
> my-service-template}})) - It'll fail when trying to copy the 
> service-template's resources like so:
> {{cannot copy tree '': not a directory}}
> In the latter ({{create-archive}}), any relative path usage will result in an 
> error claiming the file does not exist.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-210) Relative paths may cause issues in `aria service-templates` commands

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001337#comment-16001337
 ] 

ASF GitHub Bot commented on ARIA-210:
-

Github user ran-z commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/128#discussion_r115324345
  
--- Diff: aria/cli/csar.py ---
@@ -38,17 +38,19 @@
 }
 
 
-def write(source, entry, destination, logger):
-source = os.path.expanduser(source)
-destination = os.path.expanduser(destination)
-entry_definitions = os.path.join(source, entry)
+def write(service_template_path, destination, logger):
--- End diff --

good, i like the signature better this way


> Relative paths may cause issues in `aria service-templates` commands
> 
>
> Key: ARIA-210
> URL: https://issues.apache.org/jira/browse/ARIA-210
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Avia Efrat
>
> The CLI commands {{aria service-templates store}} and {{aria 
> service-templates create-archive}} use the {{os.path.dirname}} method to get 
> the directory of the main service-template file.
> In the former ({{store}} command) this causes errors when the user is already 
> in the directory of the main service-template file and passes the file 
> directly (e.g. {{aria service-templates store service-template.yaml 
> my-service-template}})) - It'll fail when trying to copy the 
> service-template's resources like so:
> {{cannot copy tree '': not a directory}}
> In the latter ({{create-archive}}), any relative path usage will result in an 
> error claiming the file does not exist.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] incubator-ariatosca pull request #128: ARIA-210 Handle relative paths in CLI...

2017-05-08 Thread ran-z
Github user ran-z commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/128#discussion_r115325816
  
--- Diff: aria/cli/service_template_utils.py ---
@@ -53,7 +53,7 @@ def get(source, service_template_filename):
 return _get_service_template_file_from_archive(source, 
service_template_filename)
--- End diff --

What about adding a short test or two for these scenarios? :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-ariatosca pull request #128: ARIA-210 Handle relative paths in CLI...

2017-05-08 Thread ran-z
Github user ran-z commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/128#discussion_r115324345
  
--- Diff: aria/cli/csar.py ---
@@ -38,17 +38,19 @@
 }
 
 
-def write(source, entry, destination, logger):
-source = os.path.expanduser(source)
-destination = os.path.expanduser(destination)
-entry_definitions = os.path.join(source, entry)
+def write(service_template_path, destination, logger):
--- End diff --

good, i like the signature better this way


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-ariatosca pull request #128: ARIA-210 Handle relative paths in CLI...

2017-05-08 Thread ran-z
Github user ran-z commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/128#discussion_r115324450
  
--- Diff: aria/cli/commands/service_templates.py ---
@@ -195,7 +195,9 @@ def create_archive(service_template_path, destination, 
logger):
 `destination` is the path of the output CSAR archive file
 """
 logger.info('Creating a CSAR archive')
-csar.write(os.path.dirname(service_template_path), 
service_template_path, destination, logger)
+if not destination.endswith('.csar'):
--- End diff --

maybe extract `.csar` suffix to a constant in csar.py? seems like its 
defined in several places now


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-155) Clean models from unused fields

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001286#comment-16001286
 ] 

ASF subversion and git services commented on ARIA-155:
--

Commit d0c5e6fa1732a1b90992a7a75721b408f8a1b575 in incubator-ariatosca's branch 
refs/heads/ARIA-148-extra-cli-commands from [~ran]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=d0c5e6f ]

ARIA-155 Clean models from unused fields


> Clean models from unused fields
> ---
>
> Key: ARIA-155
> URL: https://issues.apache.org/jira/browse/ARIA-155
> Project: AriaTosca
>  Issue Type: Task
>Reporter: Ran Ziv
>Assignee: Ran Ziv
>Priority: Minor
> Fix For: 0.1.0
>
>
> Some models have fields which should probably be removed (as they're no 
> longer in use or haven't been put to use yet) or rename (due to 
> inconsistencies).
> Suggested changes:
> Service changes module:
>  - remove module entirely, until we actually implement scaling / 
> service-update
> Service:
>  - remove {{permalink}}
>  - remove {{scaling_groups}}
> Node:
>  - remove {{scaling_groups}}
> Operation:
>  - rename {{max_retries}} to {{max_attempts}}
> OperationTemplate:
>  - rename {{max_retries}} to {{max_attempts}}
> Execution:
>  - remove {{is_system_workflow}}
> Task:
>  - rename {{retry_count}} to {{attempts_count}}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-156) Workflow runner continues to run when exception is raised on task_started event

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001290#comment-16001290
 ] 

ASF subversion and git services commented on ARIA-156:
--

Commit 1cb3086f38bc35a6a5e588aa5e340cb4fa5cacf5 in incubator-ariatosca's branch 
refs/heads/ARIA-148-extra-cli-commands from [~avia]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=1cb3086 ]

ARIA-156 Better handle exceptions in the process executor

Previously, if an exception was raised during the starting of a task,
the task's process was permanently blocked on receiving a message.

The reason was that the exception caused the 'listener thread' to
not send a response to the task's process, as the exception was not
handled inside the 'with' block of the listener thread.

The first change I introduced was to wrap the yielding of the message and
the response inside a try-except-finally block, so the exception will be
handled within the 'with' scope, and to ensure a response is sent to the
task's process.

The second change is to move the sending of the 'task started' message in
the task's process to a place where encountering an exception will be
handled via sending a 'task failed' message back to the listener thread.


> Workflow runner continues to run when exception is raised on task_started 
> event
> ---
>
> Key: ARIA-156
> URL: https://issues.apache.org/jira/browse/ARIA-156
> Project: AriaTosca
>  Issue Type: Bug
>Affects Versions: 0.1.0
>Reporter: Avia Efrat
>Assignee: Avia Efrat
> Fix For: 0.1.0
>
>
> If an exception is raised during _task_started, the engine continues to run, 
> but it finds no executable tasks or ended tasks.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-148) Enhance CLI "show" commands

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001294#comment-16001294
 ] 

ASF subversion and git services commented on ARIA-148:
--

Commit 57eeb7162af01d5955dcc0ed443533682ed4c9d2 in incubator-ariatosca's branch 
refs/heads/ARIA-148-extra-cli-commands from [~emblemparade]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=57eeb71 ]

ARIA-148 Add CLI display commands


> Enhance CLI "show" commands
> ---
>
> Key: ARIA-148
> URL: https://issues.apache.org/jira/browse/ARIA-148
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>
> For {{aria service-templates show}} and {{aria services show}} add support 
> for dumping, including graphs and type hierarchies, in JSON and YAML.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-161) End-to-end tests are mistakenly run on Windows

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001287#comment-16001287
 ] 

ASF subversion and git services commented on ARIA-161:
--

Commit 08785262e21b14c3c124c6d6a8217b8faac1c5f7 in incubator-ariatosca's branch 
refs/heads/ARIA-148-extra-cli-commands from [~ran]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=0878526 ]

ARIA-161 Disable end2end tests on Windows


> End-to-end tests are mistakenly run on Windows
> --
>
> Key: ARIA-161
> URL: https://issues.apache.org/jira/browse/ARIA-161
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Ran Ziv
>Priority: Minor
> Fix For: 0.1.0
>
>
> The Windows CI on Appveyor currently fails as it mistakenly tries running the 
> end-to-end tests.
> The tests are only relevant for Linux environment and depend on the {{sh}} 
> library which isn't compatible with Windows.
> The end-to-end tests should be made not to run on Windows CI.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-163) Update node state for stub tasks

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001288#comment-16001288
 ] 

ASF subversion and git services commented on ARIA-163:
--

Commit 8ca3ff297b71e270eccdd9a2e6b8bf468ccdab5d in incubator-ariatosca's branch 
refs/heads/ARIA-148-extra-cli-commands from [~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=8ca3ff2 ]

ARIA-163 Update node state for empty tasks

Additional changes:
 * removed `for_node` and `for_relationship` from the api OperationTask.
 * api based OperationTask could also have an empty implementation.
 * each core task wields its own executor.
 * Reordered some of the helper functions for creating tasks.
 * intoduced 2 new executors: StubTaskExecutor (for stub tasks) and 
EmptyOperationExecutor (for empty tasks)


> Update node state for stub tasks
> 
>
> Key: ARIA-163
> URL: https://issues.apache.org/jira/browse/ARIA-163
> Project: AriaTosca
>  Issue Type: Story
>Affects Versions: 0.1.0
>Reporter: Maxim Orlov
>Assignee: Maxim Orlov
> Fix For: 0.1.0
>
>
> Currently each node that has no implementation for an operation, has its 
> operations labeled a stub tasks. Those stub tasks aren't run through the 
> normal path of the workflow engine, and thus no update to the state of the 
> node is being done. this should be fixed.
> This ticket should also take care of the following:
>  - Removal of the now-deprecated {{for_node}} and {{for_relationship}} 
> methods for creating api tasks
>  - Refactoring of the helper "safe methods" for creating API tasks - i.e., 
> the methods which are currently under {{workflows/builtin/utils.py}} that 
> catch errors for non-existing operations (missing interface or operation name 
> - as opposed to empty operation declarations). These methods should be put 
> under {{worfklows/api/tasks.py}} instead.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-214) Dry execution changes the state of non-implemented (empty) operations

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001293#comment-16001293
 ] 

ASF subversion and git services commented on ARIA-214:
--

Commit 0ec237071ebdeb28cd2feabbc1b51854543d398d in incubator-ariatosca's branch 
refs/heads/ARIA-148-extra-cli-commands from [~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=0ec2370 ]

ARIA-214 Dry execution changes the state of non implemented operations


> Dry execution changes the state of non-implemented (empty) operations
> -
>
> Key: ARIA-214
> URL: https://issues.apache.org/jira/browse/ARIA-214
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Maxim Orlov
>Assignee: Maxim Orlov
> Fix For: 0.1.0
>
>
> When executing a dry workflow execution, empty tasks still raise task events, 
> which may lead to changes in the node states.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-158) Restore support for relationship ordering

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-158?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001285#comment-16001285
 ] 

ASF subversion and git services commented on ARIA-158:
--

Commit 1f3e7ff42fefcd5dc8191e3b0eeac0460db059b0 in incubator-ariatosca's branch 
refs/heads/ARIA-148-extra-cli-commands from [~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=1f3e7ff ]

ARIA-158 Restore support for relationship ordering


> Restore support for relationship ordering
> -
>
> Key: ARIA-158
> URL: https://issues.apache.org/jira/browse/ARIA-158
> Project: AriaTosca
>  Issue Type: Bug
>Affects Versions: 0.1.0
>Reporter: Maxim Orlov
>Assignee: Maxim Orlov
> Fix For: 0.1.0
>
>
> Restore support for preserving the order of a node's relationship in storage.
> This has been done in the past (see ARIA-52) but have gone broken and 
> unnoticed since.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-160) Operation toolbelt unit tests fail spordically

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001291#comment-16001291
 ] 

ASF subversion and git services commented on ARIA-160:
--

Commit 45c158eff0d7ea97be0937cba9009522733948ae in incubator-ariatosca's branch 
refs/heads/ARIA-148-extra-cli-commands from [~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=45c158e ]

ARIA-160 Operation toolbelt unit tests fail spordically

Inroduced a filesystem based data holder


> Operation toolbelt unit tests fail spordically
> --
>
> Key: ARIA-160
> URL: https://issues.apache.org/jira/browse/ARIA-160
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
> Fix For: 0.1.0
>
>
> The unit tests in the module {{test_toolbelt.py}} fail remote builds 
> (TravisCI, Jenkins) sporadically.
> Stack trace:
> {code}
> workflow_context = WorkflowContext(deployment_id=1, 
> workflow_name=test_workflow, execution_id=1)
> executor =  at 0x7f57f8482a50>
> def test_host_ip(workflow_context, executor):
> interface_name = 'Standard'
> operation_name = 'create'
> _, dependency_node, _, _, _ = _get_elements(workflow_context)
> inputs = {'putput': True}
> interface = mock.models.create_interface(
> dependency_node.service,
> interface_name=interface_name,
> operation_name=operation_name,
> operation_kwargs=dict(implementation=op_path(host_ip, 
> module_path=__name__),
>   inputs=inputs)
> )
> dependency_node.interfaces[interface.name] = interface
> workflow_context.model.node.update(dependency_node)
> 
> @workflow
> def basic_workflow(graph, **_):
> graph.add_tasks(
> api.task.OperationTask.for_node(
> node=dependency_node,
> interface_name=interface_name,
> operation_name=operation_name,
> inputs=inputs
> )
> )
> 
> >   execute(workflow_func=basic_workflow, 
> > workflow_context=workflow_context, executor=executor)
> tests/orchestrator/context/test_toolbelt.py:101: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> tests/orchestrator/context/__init__.py:29: in execute
> eng.execute()
> aria/orchestrator/workflows/core/engine.py:59: in execute
> for task in self._ended_tasks():
> aria/orchestrator/workflows/core/engine.py:96: in 
> return (task for task in self._tasks_iter() if task.has_ended())
> aria/orchestrator/workflows/core/task.py:259: in __getattr__
> return getattr(self.model_task, attr)
> aria/orchestrator/workflows/core/task.py:178: in model_task
> return self._workflow_context.model.task.get(self._task_id)
> aria/storage/sql_mapi.py:59: in get
> result = query.first()
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2731: in first
> ret = list(self[0:1])
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2523: in 
> __getitem__
> return list(res)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2831: in 
> __iter__
> return self._execute_and_instances(context)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2854: in 
> _execute_and_instances
> result = conn.execute(querycontext.statement, self._params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:945: in 
> execute
> return meth(self, multiparams, params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/sql/elements.py:263: in 
> _execute_on_connection
> return connection._execute_clauseelement(self, multiparams, params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1053: in 
> _execute_clauseelement
> compiled_sql, distilled_params
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1189: in 
> _execute_context
> context)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1393: in 
> _handle_dbapi_exception
> exc_info
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/util/compat.py:203: in 
> raise_from_cause
> reraise(type(exception), exception, tb=exc_tb, cause=cause)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1182: in 
> _execute_context
> context)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> self =  0x7f57f97ee250>
> cursor = 
> statement = 'SELECT task.id AS task_id, task.name AS task_name, 
> task.implementation AS task_implementation, task.max_attempts AS t..._fk AS 
> task_execution_fk, task.relationship_fk AS task_relationship_fk 
> FROM task 
> WHERE task.id = ?
>  

[jira] [Commented] (ARIA-209) service-templates create-archive command help is badly formatted

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001289#comment-16001289
 ] 

ASF subversion and git services commented on ARIA-209:
--

Commit 85539771c09ec34126fd03960ac3d242f226ddeb in incubator-ariatosca's branch 
refs/heads/ARIA-148-extra-cli-commands from [~ran]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=8553977 ]

ARIA-209 Fix create-archive CLI command help


> service-templates create-archive command help is badly formatted
> 
>
> Key: ARIA-209
> URL: https://issues.apache.org/jira/browse/ARIA-209
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Ran Ziv
>Priority: Trivial
> Fix For: 0.1.0
>
>
> The {{aria service-templates create-archive}} CLI command's help is badly 
> formatted.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-215) Refactor plugin-related code from ProcessExecutor into PluginManager

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001292#comment-16001292
 ] 

ASF subversion and git services commented on ARIA-215:
--

Commit 3e1ed14c00ea2c83fafdca8ec0e37817bea1d5e8 in incubator-ariatosca's branch 
refs/heads/ARIA-148-extra-cli-commands from [~ran]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=3e1ed14 ]

ARIA-215 Refactor plugin-related code into PluginManager

Refactored plugin-related code from ProcessExecutor into PluginManager.
Additionally, renamed plugin_prefix to plugin_dir in PluginManager.


> Refactor plugin-related code from ProcessExecutor into PluginManager
> 
>
> Key: ARIA-215
> URL: https://issues.apache.org/jira/browse/ARIA-215
> Project: AriaTosca
>  Issue Type: Task
>Reporter: Ran Ziv
>Assignee: Ran Ziv
>Priority: Minor
> Fix For: 0.1.0
>
>
> {{ProcessExecutor}} currently handles the code for loading a plugin into an 
> environment - this code should move into the {{PluginManager}} class instead.
> Additionally, {{PluginManager}}'s {{plugin_prefix}} method should be renamed 
> to {{plugin_dir}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[12/15] incubator-ariatosca git commit: ARIA-160 Operation toolbelt unit tests fail spordically

2017-05-08 Thread emblemparade
ARIA-160 Operation toolbelt unit tests fail spordically

Inroduced a filesystem based data holder


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 45c158eff0d7ea97be0937cba9009522733948ae
Parents: 1cb3086
Author: max-orlov 
Authored: Wed May 3 12:42:27 2017 +0300
Committer: max-orlov 
Committed: Sun May 7 14:59:29 2017 +0300

--
 aria/orchestrator/workflows/core/task.py |  5 +-
 tests/helpers.py | 38 ++
 tests/orchestrator/context/test_operation.py | 87 +--
 tests/orchestrator/context/test_toolbelt.py  | 18 +++--
 4 files changed, 100 insertions(+), 48 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45c158ef/aria/orchestrator/workflows/core/task.py
--
diff --git a/aria/orchestrator/workflows/core/task.py 
b/aria/orchestrator/workflows/core/task.py
index 0e081c2..78159c4 100644
--- a/aria/orchestrator/workflows/core/task.py
+++ b/aria/orchestrator/workflows/core/task.py
@@ -175,10 +175,9 @@ class OperationTask(BaseTask):
 self._update_fields = {}
 try:
 yield
-task = self.model_task
 for key, value in self._update_fields.items():
-setattr(task, key, value)
-self.model_task = task
+setattr(self.model_task, key, value)
+self.model_task = self.model_task
 finally:
 self._update_fields = None
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45c158ef/tests/helpers.py
--
diff --git a/tests/helpers.py b/tests/helpers.py
index 472d696..423e63f 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -14,6 +14,8 @@
 # limitations under the License.
 
 import os
+import tempfile
+import json
 
 from . import ROOT_DIR
 from .resources import DIR as RESOURCES_DIR
@@ -29,3 +31,39 @@ def get_resource_uri(*args):
 
 def get_service_template_uri(*args):
 return os.path.join(RESOURCES_DIR, 'service-templates', *args)
+
+
+class FilesystemDataHolder(object):
+_tmpfile = tempfile.NamedTemporaryFile('w')
+
+def _load(self):
+return json.load(open(self._tmpfile.name))
+
+def _dump(self, value):
+return json.dump(value, open(self._tmpfile.name, 'w'))
+
+def __init__(self):
+self.clear()
+
+def __setitem__(self, key, value):
+dict_ = self._load()
+dict_[key] = value
+self._dump(dict_)
+
+def __getitem__(self, item):
+return self._load()[item]
+
+def __iter__(self):
+return iter(self._load())
+
+def clear(self):
+self._dump({})
+
+def get(self, item, default=None):
+return self._load().get(item, default)
+
+def setdefault(self, key, value):
+dict_ = self._load()
+return_value = dict_.setdefault(key, value)
+self._dump(dict_)
+return return_value

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45c158ef/tests/orchestrator/context/test_operation.py
--
diff --git a/tests/orchestrator/context/test_operation.py 
b/tests/orchestrator/context/test_operation.py
index 971e0db..3180d89 100644
--- a/tests/orchestrator/context/test_operation.py
+++ b/tests/orchestrator/context/test_operation.py
@@ -28,14 +28,17 @@ from aria.orchestrator import context
 from aria.orchestrator.workflows import api
 
 import tests
-from tests import mock, storage
+from tests import (
+mock,
+storage,
+helpers
+)
 from . import (
 op_path,
 execute,
 )
 
-global_test_holder = {}
-
+global_test_holder = helpers.FilesystemDataHolder()
 
 @pytest.fixture
 def ctx(tmpdir):
@@ -75,7 +78,7 @@ def test_node_operation_task_execution(ctx, thread_executor):
 node.service,
 interface_name,
 operation_name,
-operation_kwargs=dict(implementation=op_path(basic_operation, 
module_path=__name__),
+operation_kwargs=dict(implementation=op_path(basic_node_operation, 
module_path=__name__),
   inputs=inputs)
 )
 node.interfaces[interface.name] = interface
@@ -94,18 +97,11 @@ def test_node_operation_task_execution(ctx, 
thread_executor):
 
 execute(workflow_func=basic_workflow, workflow_context=ctx, 
executor=thread_executor)
 
-operation_context = 

[13/15] incubator-ariatosca git commit: ARIA-215 Refactor plugin-related code into PluginManager

2017-05-08 Thread emblemparade
ARIA-215 Refactor plugin-related code into PluginManager

Refactored plugin-related code from ProcessExecutor into PluginManager.
Additionally, renamed plugin_prefix to plugin_dir in PluginManager.


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 3e1ed14c00ea2c83fafdca8ec0e37817bea1d5e8
Parents: 45c158e
Author: Ran Ziv 
Authored: Sun May 7 16:36:39 2017 +0300
Committer: Ran Ziv 
Committed: Sun May 7 17:27:36 2017 +0300

--
 aria/orchestrator/plugin.py | 36 +++-
 aria/orchestrator/workflows/executor/process.py | 60 ++--
 aria/utils/process.py   | 47 +++
 tests/utils/test_plugin.py  |  6 +-
 4 files changed, 100 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3e1ed14c/aria/orchestrator/plugin.py
--
diff --git a/aria/orchestrator/plugin.py b/aria/orchestrator/plugin.py
index f99666c..8fbcf5a 100644
--- a/aria/orchestrator/plugin.py
+++ b/aria/orchestrator/plugin.py
@@ -23,6 +23,9 @@ from datetime import datetime
 import wagon
 
 from . import exceptions
+from ..utils import process as process_utils
+
+_IS_WIN = os.name == 'nt'
 
 
 class PluginManager(object):
@@ -62,11 +65,40 @@ class PluginManager(object):
 raise exceptions.PluginAlreadyExistsError(
 'Plugin {0}, version {1} already 
exists'.format(plugin.package_name,
 
plugin.package_version))
-self._install_wagon(source=source, 
prefix=self.get_plugin_prefix(plugin))
+self._install_wagon(source=source, prefix=self.get_plugin_dir(plugin))
 self._model.plugin.put(plugin)
 return plugin
 
-def get_plugin_prefix(self, plugin):
+def load_plugin(self, plugin, env=None):
+"""
+Load the plugin into an environment.
+Loading the plugin means the plugin's code and binaries paths will be 
appended to the
+environment's PATH and PYTHONPATH, thereby allowing usage of the 
plugin.
+:param plugin: The plugin to load
+:param env: The environment to load the plugin into; If `None`, 
os.environ will be used.
+"""
+env = env or os.environ
+plugin_dir = self.get_plugin_dir(plugin)
+
+# Update PATH environment variable to include plugin's bin dir
+bin_dir = 'Scripts' if _IS_WIN else 'bin'
+process_utils.append_to_path(os.path.join(plugin_dir, bin_dir), 
env=env)
+
+# Update PYTHONPATH environment variable to include plugin's 
site-packages
+# directories
+if _IS_WIN:
+pythonpath_dirs = [os.path.join(plugin_dir, 'Lib', 
'site-packages')]
+else:
+# In some linux environments, there will be both a lib and a lib64 
directory
+# with the latter, containing compiled packages.
+pythonpath_dirs = [os.path.join(
+plugin_dir, 'lib{0}'.format(b),
+'python{0}.{1}'.format(sys.version_info[0], 
sys.version_info[1]),
+'site-packages') for b in ('', '64')]
+
+process_utils.append_to_pythonpath(*pythonpath_dirs, env=env)
+
+def get_plugin_dir(self, plugin):
 return os.path.join(
 self._plugins_dir,
 '{0}-{1}'.format(plugin.package_name, plugin.package_version))

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3e1ed14c/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index 8481406..f3daf04 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -47,13 +47,12 @@ from aria.storage import instrumentation
 from aria.extension import process_executor
 from aria.utils import (
 imports,
-exceptions
+exceptions,
+process as process_utils
 )
 from aria.modeling import types as modeling_types
 
 
-_IS_WIN = os.name == 'nt'
-
 _INT_FMT = 'I'
 _INT_SIZE = struct.calcsize(_INT_FMT)
 UPDATE_TRACKED_CHANGES_FAILED_STR = \
@@ -127,13 +126,7 @@ class ProcessExecutor(base.BaseExecutor):
 with open(arguments_json_path, 'wb') as f:
 f.write(pickle.dumps(self._create_arguments_dict(task)))
 
-env = 

[07/15] incubator-ariatosca git commit: ARIA-155 Clean models from unused fields

2017-05-08 Thread emblemparade
ARIA-155 Clean models from unused fields


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: d0c5e6fa1732a1b90992a7a75721b408f8a1b575
Parents: 1f3e7ff
Author: Ran Ziv 
Authored: Sun Apr 30 15:15:37 2017 +0300
Committer: Ran Ziv 
Committed: Sun Apr 30 15:39:21 2017 +0300

--
 aria/modeling/orchestration.py  |   7 +-
 aria/modeling/service_instance.py   |  28 ++---
 aria/modeling/service_template.py   |  16 +--
 .../workflows/core/events_handler.py|   4 +-
 aria/orchestrator/workflows/core/task.py|  14 +--
 tests/mock/models.py|   3 -
 tests/modeling/test_mixins.py   |   3 -
 tests/modeling/test_models.py   | 103 ---
 tests/orchestrator/workflows/core/test_task.py  |   8 +-
 .../orchestrator/workflows/executor/__init__.py |   2 +-
 10 files changed, 77 insertions(+), 111 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d0c5e6fa/aria/modeling/orchestration.py
--
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index f163903..ab9d34d 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -92,7 +92,6 @@ class ExecutionBase(ModelMixin):
 started_at = Column(DateTime, nullable=True, index=True)
 ended_at = Column(DateTime, nullable=True, index=True)
 error = Column(Text, nullable=True)
-is_system_workflow = Column(Boolean, nullable=False, default=False)
 status = Column(Enum(*STATES, name='execution_status'), default=PENDING)
 workflow_name = Column(Text)
 
@@ -252,8 +251,8 @@ class TaskBase(ModelMixin):
 :vartype started_at: datetime
 :ivar ended_at: Timestamp for when task ended
 :vartype ended_at: datetime
-:ivar retry_count: How many retries occurred
-:vartype retry_count: int
+:ivar attempts_count: How many attempts occurred
+:vartype attempts_count: int
 """
 
 __tablename__ = 'task'
@@ -314,7 +313,7 @@ class TaskBase(ModelMixin):
 due_at = Column(DateTime, nullable=False, index=True, 
default=datetime.utcnow())
 started_at = Column(DateTime, default=None)
 ended_at = Column(DateTime, default=None)
-retry_count = Column(Integer, default=0)
+attempts_count = Column(Integer, default=1)
 
 def has_ended(self):
 return self.status in (self.SUCCESS, self.FAILED)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d0c5e6fa/aria/modeling/service_instance.py
--
diff --git a/aria/modeling/service_instance.py 
b/aria/modeling/service_instance.py
index d5391ef..ad8e7ed 100644
--- a/aria/modeling/service_instance.py
+++ b/aria/modeling/service_instance.py
@@ -74,10 +74,6 @@ class ServiceBase(InstanceModelMixin):
 :vartype created_at: :class:`datetime.datetime`
 :ivar updated_at: Update timestamp
 :vartype updated_at: :class:`datetime.datetime`
-:ivar permalink: ??
-:vartype permalink: basestring
-:ivar scaling_groups: ??
-:vartype scaling_groups: {}
 :ivar modifications: Modifications of this service
 :vartype modifications: [:class:`ServiceModification`]
 :ivar updates: Updates of this service
@@ -187,13 +183,6 @@ class ServiceBase(InstanceModelMixin):
 created_at = Column(DateTime, nullable=False, index=True)
 updated_at = Column(DateTime)
 
-# region orchestration
-
-permalink = Column(Text)
-scaling_groups = Column(modeling_types.Dict)
-
-# endregion
-
 def satisfy_requirements(self):
 satisfied = True
 for node in self.nodes.itervalues():
@@ -346,8 +335,6 @@ class NodeBase(InstanceModelMixin):
 :vartype host: :class:`Node`
 :ivar runtime_properties: TODO: should be replaced with attributes
 :vartype runtime_properties: {}
-:ivar scaling_groups: ??
-:vartype scaling_groups: []
 :ivar state: The state of the node, according to to the TOSCA-defined node 
states
 :vartype state: string
 :ivar version: Used by `aria.storage.instrumentation`
@@ -530,7 +517,6 @@ class NodeBase(InstanceModelMixin):
 
 description = Column(Text)
 runtime_properties = Column(modeling_types.Dict)
-scaling_groups = Column(modeling_types.List)
 state = Column(Enum(*STATES, name='node_state'), nullable=False, 
default=INITIAL)
 version = Column(Integer, 

[05/15] incubator-ariatosca git commit: ARIA-146 Support colorful execution logging

2017-05-08 Thread emblemparade
ARIA-146 Support colorful execution logging


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 5bc28b6641c2e749b0eebca05281790d21bf3c00
Parents: 8dc7b00
Author: max-orlov 
Authored: Thu Apr 20 18:51:46 2017 +0300
Committer: max-orlov 
Committed: Thu Apr 27 15:34:09 2017 +0300

--
 aria/cli/color.py  |  95 
 aria/cli/commands/executions.py|   6 +-
 aria/cli/commands/logs.py  |   6 +-
 aria/cli/config/config.py  |  25 ++-
 aria/cli/config/config_template.yaml   |  32 +++-
 aria/cli/core/aria.py  |   9 ++
 aria/cli/execution_logging.py  | 232 +++-
 aria/cli/helptexts.py  |   1 +
 aria/cli/logger.py |   1 -
 aria/orchestrator/context/operation.py |   8 +-
 10 files changed, 366 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5bc28b66/aria/cli/color.py
--
diff --git a/aria/cli/color.py b/aria/cli/color.py
new file mode 100644
index 000..5e0355a
--- /dev/null
+++ b/aria/cli/color.py
@@ -0,0 +1,95 @@
+# 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.
+from StringIO import StringIO
+import re
+
+import colorama
+
+colorama.init()
+
+
+class StringStylizer(object):
+def __init__(self, str_, color_spec=None):
+self._str = str_
+self._color_spec = color_spec
+
+def __repr__(self):
+if self._color_spec:
+return '{schema}{str}{reset}'.format(
+schema=self._color_spec, str=str(self._str), 
reset=Colors.Style.RESET_ALL)
+return self._str
+
+def __add__(self, other):
+return str(self) + other
+
+def __radd__(self, other):
+return other + str(self)
+
+def color(self, color_spec):
+self._color_spec = color_spec
+
+def replace(self, old, new, **kwargs):
+self._str = self._str.replace(str(old), str(new), **kwargs)
+
+def format(self, *args, **kwargs):
+self._str = self._str.format(*args, **kwargs)
+
+def highlight(self, pattern, schema):
+if pattern is None:
+return
+for match in set(re.findall(re.compile(pattern), self._str)):
+self.replace(match, schema + match + Colors.Style.RESET_ALL + 
self._color_spec)
+
+
+def _get_colors(color_type):
+for name in dir(color_type):
+if not name.startswith('_'):
+yield (name.lower(), getattr(color_type, name))
+
+
+class Colors(object):
+Fore = colorama.Fore
+Back = colorama.Back
+Style = colorama.Style
+
+_colors = {
+'fore': dict(_get_colors(Fore)),
+'back': dict(_get_colors(Back)),
+'style': dict(_get_colors(Style))
+}
+
+
+class ColorSpec(object):
+def __init__(self, fore=None, back=None, style=None):
+"""
+It is possible to provide fore, back and style arguments. each could 
be either
+the color is lower case letter, or the actual color from colorama.
+
+"""
+self._kwargs = dict(fore=fore, back=back, style=style)
+self._str = StringIO()
+for type_, colors in Colors._colors.items():
+value = self._kwargs.get(type_, None)
+# the former case is if the value is a string, the latter is in 
case of an object.
+self._str.write(colors.get(value) or value)
+
+def __str__(self):
+return self._str.getvalue()
+
+def __add__(self, other):
+return str(self) + str(other)
+
+def __radd__(self, other):
+return str(other) + str(self)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5bc28b66/aria/cli/commands/executions.py

[08/15] incubator-ariatosca git commit: ARIA-161 Disable end2end tests on Windows

2017-05-08 Thread emblemparade
ARIA-161 Disable end2end tests on Windows


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 08785262e21b14c3c124c6d6a8217b8faac1c5f7
Parents: d0c5e6f
Author: Ran Ziv 
Authored: Sun Apr 30 15:40:57 2017 +0300
Committer: Ran Ziv 
Committed: Sun Apr 30 16:05:21 2017 +0300

--
 tox.ini | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/08785262/tox.ini
--
diff --git a/tox.ini b/tox.ini
index 4d86c6e..f4e9871 100644
--- a/tox.ini
+++ b/tox.ini
@@ -46,7 +46,7 @@ commands=pytest tests/end2end --cov-report term-missing --cov 
aria
 commands=pytest tests/end2end --cov-report term-missing --cov aria
 
 [testenv:pywin]
-commands=pytest tests --cov-report term-missing --cov aria
+commands=pytest tests --ignore=tests/end2end --cov-report term-missing --cov 
aria
 
 [testenv:pylint_code]
 commands=pylint --rcfile=aria/.pylintrc --disable=fixme,missing-docstring aria



[10/15] incubator-ariatosca git commit: ARIA-209 Fix create-archive CLI command help

2017-05-08 Thread emblemparade
ARIA-209 Fix create-archive CLI command help


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 85539771c09ec34126fd03960ac3d242f226ddeb
Parents: 8ca3ff2
Author: Ran Ziv 
Authored: Thu May 4 17:07:50 2017 +0300
Committer: Ran Ziv 
Committed: Thu May 4 18:01:17 2017 +0300

--
 aria/cli/commands/service_templates.py | 11 ++-
 tests/cli/test_service_templates.py|  4 ++--
 2 files changed, 8 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/85539771/aria/cli/commands/service_templates.py
--
diff --git a/aria/cli/commands/service_templates.py 
b/aria/cli/commands/service_templates.py
index 97367c2..2537012 100644
--- a/aria/cli/commands/service_templates.py
+++ b/aria/cli/commands/service_templates.py
@@ -182,20 +182,21 @@ def validate(service_template, service_template_filename,
 
 
 @service_templates.command(name='create-archive',
-   short_help='Create a csar archive')
+   short_help='Create a CSAR archive')
 @aria.argument('service-template-path')
 @aria.argument('destination')
 @aria.options.verbose()
 @aria.pass_logger
 def create_archive(service_template_path, destination, logger):
-"""Create a csar archive
+"""Create a csar archive on the local file system
 
 `service_template_path` is the path of the service template to create the 
archive from
-`destination` is the path of the output csar archive
+
+`destination` is the path of the output CSAR archive file
 """
-logger.info('Creating a csar archive')
+logger.info('Creating a CSAR archive')
 csar.write(os.path.dirname(service_template_path), service_template_path, 
destination, logger)
-logger.info('Csar archive created at {0}'.format(destination))
+logger.info('CSAR archive created at {0}'.format(destination))
 
 
 def print_service_template_inputs(model_storage, service_template_name, 
logger):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/85539771/tests/cli/test_service_templates.py
--
diff --git a/tests/cli/test_service_templates.py 
b/tests/cli/test_service_templates.py
index 01b3f67..dd9eedd 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -238,9 +238,9 @@ class TestServiceTemplatesCreateArchive(TestCliBase):
 
 monkeypatch.setattr(_Environment, 'model_storage', mock_storage)
 self.invoke('service_templates create_archive stubpath stubdest')
-assert 'Creating a csar archive' in self.logger_output_string
+assert 'Creating a CSAR archive' in self.logger_output_string
 
 def test_create_archive_successful(self, monkeypatch, mock_object):
 monkeypatch.setattr(csar, 'write', mock_object)
 self.invoke('service_templates create_archive stubpath stubdest')
-assert 'Csar archive created at stubdest' in self.logger_output_string
+assert 'CSAR archive created at stubdest' in self.logger_output_string



[01/15] incubator-ariatosca git commit: ARIA-150 Fixed simple hello-world example [Forced Update!]

2017-05-08 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-148-extra-cli-commands cf08b4bf7 -> 57eeb7162 (forced update)


ARIA-150 Fixed simple hello-world example

The simple hello-world example had a missing host node,
which caused an error at service creation phase.
The example now uses custom types which do not require
the extra host node.


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 7a4a1ddabadef814affb56778c7614256ca8fe00
Parents: 29bc84b
Author: Ran Ziv 
Authored: Sun Apr 23 15:39:57 2017 +0300
Committer: Ran Ziv 
Committed: Sun Apr 23 15:39:57 2017 +0300

--
 examples/hello-world/helloworld.yaml | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7a4a1dda/examples/hello-world/helloworld.yaml
--
diff --git a/examples/hello-world/helloworld.yaml 
b/examples/hello-world/helloworld.yaml
index b6efaca..77cef30 100644
--- a/examples/hello-world/helloworld.yaml
+++ b/examples/hello-world/helloworld.yaml
@@ -1,18 +1,23 @@
-tosca_definitions_version: tosca_simple_profile_for_nfv_1_0
+tosca_definitions_version: tosca_simple_yaml_1_0
 
 node_types:
+  web_server:
+derived_from: tosca.nodes.Root
+capabilities:
+  host:
+type: tosca.capabilities.Container
+
   web_app:
 derived_from: tosca.nodes.WebApplication
 properties:
   port:
 type: integer
-default: 8080
 
 topology_template:
 
   node_templates:
 web_server:
-  type: tosca.nodes.WebServer
+  type: web_server
 
 web_app:
   type: web_app



[02/15] incubator-ariatosca git commit: Improve execution cancelling

2017-05-08 Thread emblemparade
Improve execution cancelling

Unhandled execution status transitions resulting from cancelling an
execution via the CLI, that we indentified and tried to address:

1. TERMINATED -> CANCELLING
You cancel the execution, but by the time we try to set the status to
CANCELLING, the execution thread had already finished, and therefore,
in SUCCEEDED status.

2. FAILED -> CANCELLING
You cancel the execution, but by the time we try to set the status to
CANCELLING, the execution thread had already encountered an error,
and therefore, in FAILED state.

3. TERMINATED -> CANCELLED
Similar to #1, but with CANCELLED instead of CANCELLING.

4. FAILED -> CANCELLED
Similar to #1, but with CANCELLED instead of CANCELLING.

In all of the above cases (#1-#4), we skip updating the execution
status, and log that the execution already succeeded/failed before we
were able to cancel it.

5. CANCELLING -> STARTED
You cancel the execution while it is still in pending state. Meanwhile,
while the execution status was already set to CANCELLING, we try to set
the execution status

6. CANCELLED -> STARTED
Similar to #5, but after the status is set to CANCELLING, it also gets
set to CANCELLED before attempting to set it to STARTED.

In cases #5-#6, we skip updtating the execution status, and nothing
is logged.


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 5cd7aec550a4720fb63fa8b36c27ff52921d0b14
Parents: 7a4a1dd
Author: Avia Efrat 
Authored: Thu Apr 20 13:23:32 2017 +0300
Committer: Avia Efrat 
Committed: Wed Apr 26 15:37:06 2017 +0300

--
 aria/cli/commands/executions.py | 12 +++-
 aria/modeling/orchestration.py  |  9 +++---
 .../workflows/core/events_handler.py| 32 +++-
 aria/orchestrator/workflows/events_logging.py   |  1 +
 tests/modeling/test_models.py   | 22 +++---
 tests/orchestrator/test_workflow_runner.py  |  2 +-
 .../orchestrator/workflows/core/test_engine.py  |  2 +-
 7 files changed, 47 insertions(+), 33 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5cd7aec5/aria/cli/commands/executions.py
--
diff --git a/aria/cli/commands/executions.py b/aria/cli/commands/executions.py
index 6a1f02a..cb86376 100644
--- a/aria/cli/commands/executions.py
+++ b/aria/cli/commands/executions.py
@@ -139,7 +139,6 @@ def start(workflow_name,
 execution_thread_name = '{0}_{1}'.format(service_name, workflow_name)
 execution_thread = 
threading.ExceptionThread(target=workflow_runner.execute,
  name=execution_thread_name)
-execution_thread.daemon = True  # allows force-cancel to exit immediately
 
 logger.info('Starting {0}execution. Press Ctrl+C cancel'.format('dry ' if 
dry else ''))
 execution_thread.start()
@@ -172,11 +171,10 @@ def start(workflow_name,
 
 def _cancel_execution(workflow_runner, execution_thread, logger, log_iterator):
 logger.info('Cancelling execution. Press Ctrl+C again to force-cancel')
-try:
-workflow_runner.cancel()
-while execution_thread.is_alive():
+workflow_runner.cancel()
+while execution_thread.is_alive():
+try:
 execution_logging.log_list(log_iterator)
 execution_thread.join(1)
-except KeyboardInterrupt:
-logger.info('Force-cancelling execution')
-# TODO handle execution (update status etc.) and exit process
+except KeyboardInterrupt:
+pass

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5cd7aec5/aria/modeling/orchestration.py
--
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index b9a75e9..f163903 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -56,21 +56,20 @@ class ExecutionBase(ModelMixin):
 __private_fields__ = ['service_fk',
   'service_template']
 
-TERMINATED = 'terminated'
+SUCCEEDED = 'succeeded'
 FAILED = 'failed'
 CANCELLED = 'cancelled'
 PENDING = 'pending'
 STARTED = 'started'
 CANCELLING = 'cancelling'
-FORCE_CANCELLING = 'force_cancelling'
 
-STATES = (TERMINATED, FAILED, CANCELLED, PENDING, STARTED, CANCELLING, 
FORCE_CANCELLING)
-END_STATES = (TERMINATED, FAILED, CANCELLED)
+STATES = (SUCCEEDED, FAILED, CANCELLED, PENDING, 

[09/15] incubator-ariatosca git commit: ARIA-163 Update node state for empty tasks

2017-05-08 Thread emblemparade
ARIA-163 Update node state for empty tasks

Additional changes:
 * removed `for_node` and `for_relationship` from the api OperationTask.
 * api based OperationTask could also have an empty implementation.
 * each core task wields its own executor.
 * Reordered some of the helper functions for creating tasks.
 * intoduced 2 new executors: StubTaskExecutor (for stub tasks) and 
EmptyOperationExecutor (for empty tasks)


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 8ca3ff297b71e270eccdd9a2e6b8bf468ccdab5d
Parents: 0878526
Author: max-orlov 
Authored: Sun Apr 30 16:05:27 2017 +0300
Committer: max-orlov 
Committed: Thu May 4 17:35:56 2017 +0300

--
 aria/logger.py  |   2 +
 aria/orchestrator/workflows/api/task.py | 185 ++-
 .../workflows/builtin/execute_operation.py  |  28 +--
 aria/orchestrator/workflows/builtin/heal.py |   4 +-
 aria/orchestrator/workflows/builtin/install.py  |   9 +-
 aria/orchestrator/workflows/builtin/start.py|   4 +-
 aria/orchestrator/workflows/builtin/stop.py |   4 +-
 .../orchestrator/workflows/builtin/uninstall.py |  11 +-
 aria/orchestrator/workflows/builtin/utils.py| 138 --
 .../orchestrator/workflows/builtin/workflows.py |  71 ---
 aria/orchestrator/workflows/core/engine.py  |  12 +-
 .../workflows/core/events_handler.py|   1 -
 aria/orchestrator/workflows/core/task.py|  35 ++--
 aria/orchestrator/workflows/core/translation.py |  33 ++--
 aria/orchestrator/workflows/events_logging.py   |  13 +-
 aria/orchestrator/workflows/executor/base.py|  11 ++
 aria/orchestrator/workflows/executor/dry.py |   1 -
 .../profiles/tosca-simple-1.0/interfaces.yaml   |   5 +
 tests/end2end/test_hello_world.py   |   5 +-
 tests/end2end/testenv.py|   2 +-
 tests/orchestrator/context/test_operation.py|  32 ++--
 tests/orchestrator/context/test_serialize.py|   2 +-
 tests/orchestrator/context/test_toolbelt.py |   8 +-
 .../orchestrator/execution_plugin/test_local.py |   4 +-
 tests/orchestrator/execution_plugin/test_ssh.py |   4 +-
 tests/orchestrator/workflows/api/test_task.py   |  16 +-
 .../orchestrator/workflows/core/test_engine.py  |  60 +++---
 .../orchestrator/workflows/core/test_events.py  |   4 +-
 tests/orchestrator/workflows/core/test_task.py  |  15 +-
 .../test_task_graph_into_execution_graph.py |  25 ++-
 ...process_executor_concurrent_modifications.py |  18 +-
 .../executor/test_process_executor_extension.py |   9 +-
 .../test_process_executor_tracked_changes.py|   9 +-
 .../tosca-simple-1.0/node-cellar/workflows.py   |  10 +-
 34 files changed, 361 insertions(+), 429 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8ca3ff29/aria/logger.py
--
diff --git a/aria/logger.py b/aria/logger.py
index 8e15f5b..97d3878 100644
--- a/aria/logger.py
+++ b/aria/logger.py
@@ -195,6 +195,8 @@ class _SQLAlchemyHandler(logging.Handler):
 except BaseException:
 self._session.rollback()
 raise
+finally:
+self._session.close()
 
 
 _default_file_formatter = logging.Formatter(

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8ca3ff29/aria/orchestrator/workflows/api/task.py
--
diff --git a/aria/orchestrator/workflows/api/task.py 
b/aria/orchestrator/workflows/api/task.py
index 82c40c3..cb79eb3 100644
--- a/aria/orchestrator/workflows/api/task.py
+++ b/aria/orchestrator/workflows/api/task.py
@@ -21,6 +21,7 @@ from ... import context
 from modeling import models
 from modeling import utils as modeling_utils
 from utils.uuid import generate_uuid
+from .. import exceptions
 
 
 class BaseTask(object):
@@ -71,102 +72,44 @@ class OperationTask(BaseTask):
 Do not call this constructor directly. Instead, use :meth:`for_node` or
 :meth:`for_relationship`.
 """
-
-actor_type = type(actor).__name__.lower()
 assert isinstance(actor, (models.Node, models.Relationship))
-assert actor_type in ('node', 'relationship')
-assert interface_name and operation_name
 super(OperationTask, self).__init__()
-
 self.actor = actor
-self.max_attempts = (self.workflow_context._task_max_attempts
- if max_attempts is None 

[04/15] incubator-ariatosca git commit: ARIA-154 Create end-to-end test for the Nodecellar example

2017-05-08 Thread emblemparade
ARIA-154 Create end-to-end test for the Nodecellar example


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 8dc7b0060bedf25c5b135b9b014c3a1f87d6aaf2
Parents: d91696b
Author: Ran Ziv 
Authored: Thu Apr 27 15:11:15 2017 +0300
Committer: Ran Ziv 
Committed: Thu Apr 27 15:11:15 2017 +0300

--
 tests/end2end/test_nodecellar.py| 42 
 .../tosca-simple-1.0/node-cellar/workflows.py   |  5 +--
 2 files changed, 44 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8dc7b006/tests/end2end/test_nodecellar.py
--
diff --git a/tests/end2end/test_nodecellar.py b/tests/end2end/test_nodecellar.py
new file mode 100644
index 000..25ce7a0
--- /dev/null
+++ b/tests/end2end/test_nodecellar.py
@@ -0,0 +1,42 @@
+# 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.
+
+from .testenv import testenv  # pylint: disable=unused-import
+from .. import helpers
+
+
+def test_nodecellar(testenv):
+nodecellar_template_uri = helpers.get_service_template_uri(
+'tosca-simple-1.0', 'node-cellar', 'node-cellar.yaml')
+
+service_name = testenv.install_service(nodecellar_template_uri, dry=True)
+_verify_deployed_service_in_storage(service_name, testenv.model_storage)
+
+# testing dry execution of custom workflows
+testenv.execute_workflow(service_name, 'maintenance_on', dry=True)
+testenv.execute_workflow(service_name, 'maintenance_off', dry=True)
+
+testenv.uninstall_service(dry=True)
+testenv.verify_clean_storage()
+
+
+def _verify_deployed_service_in_storage(service_name, model_storage):
+service_templates = model_storage.service_template.list()
+assert len(service_templates) == 1
+assert len(service_templates[0].services) == 1
+service = service_templates[0].services[0]
+assert service.name == service_name
+assert len(service.executions) == 0  # dry executions leave no traces
+assert len(service.nodes) == 10

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8dc7b006/tests/resources/service-templates/tosca-simple-1.0/node-cellar/workflows.py
--
diff --git 
a/tests/resources/service-templates/tosca-simple-1.0/node-cellar/workflows.py 
b/tests/resources/service-templates/tosca-simple-1.0/node-cellar/workflows.py
index 94ee824..abe1ee2 100644
--- 
a/tests/resources/service-templates/tosca-simple-1.0/node-cellar/workflows.py
+++ 
b/tests/resources/service-templates/tosca-simple-1.0/node-cellar/workflows.py
@@ -1,6 +1,5 @@
-
 from aria import workflow
-from aria.orchestrator.workflows.api.task import OperationTask
+from aria.orchestrator.workflows.builtin import utils
 from aria.orchestrator.workflows.exceptions import TaskException
 
 
@@ -17,7 +16,7 @@ def maintenance(ctx, graph, enabled):
 
 for node in ctx.model.node.iter():
 try:
-graph.add_tasks(OperationTask.for_node(node=node,
+graph.add_tasks(utils.create_node_task(node=node,

interface_name=INTERFACE_NAME,

operation_name=ENABLE_OPERATION_NAME if enabled
else 
DISABLE_OPERATION_NAME))



[11/15] incubator-ariatosca git commit: ARIA-156 Better handle exceptions in the process executor

2017-05-08 Thread emblemparade
ARIA-156 Better handle exceptions in the process executor

Previously, if an exception was raised during the starting of a task,
the task's process was permanently blocked on receiving a message.

The reason was that the exception caused the 'listener thread' to
not send a response to the task's process, as the exception was not
handled inside the 'with' block of the listener thread.

The first change I introduced was to wrap the yielding of the message and
the response inside a try-except-finally block, so the exception will be
handled within the 'with' scope, and to ensure a response is sent to the
task's process.

The second change is to move the sending of the 'task started' message in
the task's process to a place where encountering an exception will be
handled via sending a 'task failed' message back to the listener thread.


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 1cb3086f38bc35a6a5e588aa5e340cb4fa5cacf5
Parents: 8553977
Author: Avia Efrat 
Authored: Sun May 7 11:42:58 2017 +0300
Committer: Avia Efrat 
Committed: Sun May 7 14:44:01 2017 +0300

--
 aria/orchestrator/workflows/executor/process.py | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1cb3086f/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index 2378e0a..8481406 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -213,8 +213,13 @@ class ProcessExecutor(base.BaseExecutor):
 with contextlib.closing(self._server_socket.accept()[0]) as connection:
 message = _recv_message(connection)
 response = {}
-yield message, response
-_send_message(connection, response)
+try:
+yield message, response
+except BaseException as e:
+response['exception'] = exceptions.wrap_if_needed(e)
+raise
+finally:
+_send_message(connection, response)
 
 def _handle_task_started_request(self, task_id, **kwargs):
 self._task_started(self._tasks[task_id])
@@ -378,7 +383,6 @@ def _main():
 task_id = arguments['task_id']
 port = arguments['port']
 messenger = _Messenger(task_id=task_id, port=port)
-messenger.started()
 
 implementation = arguments['implementation']
 operation_inputs = arguments['operation_inputs']
@@ -390,6 +394,7 @@ def _main():
 
 with instrumentation.track_changes() as instrument:
 try:
+messenger.started()
 ctx = 
context_dict['context_cls'].deserialize_from_dict(**context_dict['context'])
 _patch_session(ctx=ctx, messenger=messenger, instrument=instrument)
 task_func = imports.load_attribute(implementation)



[03/15] incubator-ariatosca git commit: ARIA-153 Write end-to-end tests for ARIA

2017-05-08 Thread emblemparade
ARIA-153 Write end-to-end tests for ARIA

Created infrastructure for end-to-end tests,
plus a test for the hello-world example.


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: d91696bdf5d208ff57496df23026341bc6cfa351
Parents: 5cd7aec
Author: Ran Ziv 
Authored: Wed Apr 26 20:21:19 2017 +0300
Committer: Ran Ziv 
Committed: Thu Apr 27 14:28:10 2017 +0300

--
 .travis.yml   |  2 +
 tests/end2end/__init__.py |  0
 tests/end2end/test_hello_world.py | 61 +
 tests/end2end/testenv.py  | 96 ++
 tests/helpers.py  | 31 +++
 tests/parser/service_templates.py |  9 ++--
 tests/parser/utils.py | 16 --
 tests/requirements.txt|  1 +
 tox.ini   | 14 +++--
 9 files changed, 207 insertions(+), 23 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d91696bd/.travis.yml
--
diff --git a/.travis.yml b/.travis.yml
index 5413ff2..b11ed62 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,6 +19,8 @@ env:
 - TOX_ENV=pylint_tests
 - TOX_ENV=py27
 - TOX_ENV=py26
+- TOX_ENV=py27e2e
+- TOX_ENV=py26e2e
 install:
   - pip install --upgrade pip
   - pip install --upgrade setuptools

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d91696bd/tests/end2end/__init__.py
--
diff --git a/tests/end2end/__init__.py b/tests/end2end/__init__.py
new file mode 100644
index 000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/d91696bd/tests/end2end/test_hello_world.py
--
diff --git a/tests/end2end/test_hello_world.py 
b/tests/end2end/test_hello_world.py
new file mode 100644
index 000..09e5d06
--- /dev/null
+++ b/tests/end2end/test_hello_world.py
@@ -0,0 +1,61 @@
+# 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 requests
+
+from .testenv import testenv  # pylint: disable=unused-import
+from .. import helpers
+
+
+def test_hello_world(testenv):
+hello_world_template_uri = helpers.get_example_uri('hello-world', 
'helloworld.yaml')
+service_name = testenv.install_service(hello_world_template_uri)
+
+try:
+_verify_deployed_service_in_storage(service_name, 
testenv.model_storage)
+_verify_webserver_up('http://localhost:9090')
+finally:
+# Even if some assertions failed, attempt to execute uninstall so the
+# webserver process doesn't stay up once the test is finished
+# TODO: remove force_service_delete=True
+testenv.uninstall_service(force_service_delete=True)
+
+_verify_webserver_down('http://localhost:9090')
+testenv.verify_clean_storage()
+
+
+def _verify_webserver_up(http_endpoint):
+server_response = requests.get(http_endpoint, timeout=10)
+assert server_response.status_code == 200
+
+
+def _verify_webserver_down(http_endpoint):
+try:
+requests.get(http_endpoint, timeout=10)
+assert False
+except requests.exceptions.ConnectionError:
+pass
+
+
+def _verify_deployed_service_in_storage(service_name, model_storage):
+service_templates = model_storage.service_template.list()
+assert len(service_templates) == 1
+assert len(service_templates[0].services) == 1
+service = service_templates[0].services[0]
+assert service.name == service_name
+assert len(service.executions) == 1
+assert len(service.nodes) == 2
+# TODO: validate node states
+assert len(service.executions[0].logs) > 0


[14/15] incubator-ariatosca git commit: ARIA-214 Dry execution changes the state of non implemented operations

2017-05-08 Thread emblemparade
ARIA-214 Dry execution changes the state of non implemented operations


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

Branch: refs/heads/ARIA-148-extra-cli-commands
Commit: 0ec237071ebdeb28cd2feabbc1b51854543d398d
Parents: 3e1ed14
Author: max-orlov 
Authored: Sun May 7 16:12:56 2017 +0300
Committer: max-orlov 
Committed: Sun May 7 22:29:53 2017 +0300

--
 aria/orchestrator/workflows/core/task.py|  3 ---
 aria/orchestrator/workflows/core/translation.py |  6 +
 aria/orchestrator/workflows/executor/base.py| 19 --
 aria/orchestrator/workflows/executor/celery.py  |  2 +-
 aria/orchestrator/workflows/executor/dry.py | 26 ++--
 aria/orchestrator/workflows/executor/process.py |  2 +-
 aria/orchestrator/workflows/executor/thread.py  |  2 +-
 tests/orchestrator/workflows/core/test_task.py  |  7 ++
 .../workflows/executor/test_process_executor.py | 18 +-
 9 files changed, 31 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/0ec23707/aria/orchestrator/workflows/core/task.py
--
diff --git a/aria/orchestrator/workflows/core/task.py 
b/aria/orchestrator/workflows/core/task.py
index 78159c4..b3dfb3c 100644
--- a/aria/orchestrator/workflows/core/task.py
+++ b/aria/orchestrator/workflows/core/task.py
@@ -163,9 +163,6 @@ class OperationTask(BaseTask):
 self._task_id = task_model.id
 self._update_fields = None
 
-def execute(self):
-super(OperationTask, self).execute()
-
 @contextmanager
 def _update(self):
 """

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/0ec23707/aria/orchestrator/workflows/core/translation.py
--
diff --git a/aria/orchestrator/workflows/core/translation.py 
b/aria/orchestrator/workflows/core/translation.py
index 0bbce90..fec108b 100644
--- a/aria/orchestrator/workflows/core/translation.py
+++ b/aria/orchestrator/workflows/core/translation.py
@@ -48,11 +48,7 @@ def build_execution_graph(
 execution_graph, dependencies, default=[start_task])
 
 if isinstance(api_task, api.task.OperationTask):
-if api_task.implementation:
-operation_task = core_task.OperationTask(api_task, 
executor=default_executor)
-else:
-operation_task = core_task.OperationTask(api_task,
- 
executor=base.EmptyOperationExecutor())
+operation_task = core_task.OperationTask(api_task, 
executor=default_executor)
 _add_task_and_dependencies(execution_graph, operation_task, 
operation_dependencies)
 elif isinstance(api_task, api.task.WorkflowTask):
 # Build the graph recursively while adding start and end markers

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/0ec23707/aria/orchestrator/workflows/executor/base.py
--
diff --git a/aria/orchestrator/workflows/executor/base.py 
b/aria/orchestrator/workflows/executor/base.py
index a225837..c543278 100644
--- a/aria/orchestrator/workflows/executor/base.py
+++ b/aria/orchestrator/workflows/executor/base.py
@@ -25,13 +25,22 @@ class BaseExecutor(logger.LoggerMixin):
 """
 Base class for executors for running tasks
 """
+def _execute(self, task):
+raise NotImplementedError
 
 def execute(self, task):
 """
 Execute a task
 :param task: task to execute
 """
-raise NotImplementedError
+if task.implementation:
+self._execute(task)
+else:
+# In this case the task is missing an implementation. This task 
still gets to an
+# executor, but since there is nothing to run, we by default 
simply skip the execution
+# itself.
+self._task_started(task)
+self._task_succeeded(task)
 
 def close(self):
 """
@@ -52,12 +61,6 @@ class BaseExecutor(logger.LoggerMixin):
 events.on_success_task_signal.send(task)
 
 
-class StubTaskExecutor(BaseExecutor):
+class StubTaskExecutor(BaseExecutor):  
 # pylint: disable=abstract-method
 def execute(self, task):
 task.status = task.SUCCESS
-
-
-class EmptyOperationExecutor(BaseExecutor):
-def execute(self, task):
-

[GitHub] incubator-ariatosca pull request #128: ARIA-210 Handle relative paths in CLI...

2017-05-08 Thread AviaE
GitHub user AviaE opened a pull request:

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

ARIA-210 Handle relative paths in CLI service-templates

This was a rather simple change, mainly involving adding absolute path
references.

The problems were only in `service-templates store` and in
`service-templates create-archive`.
`service-templates validate` was not affected.

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

$ git pull https://github.com/apache/incubator-ariatosca 
ARIA-210-handle-relative-paths-in-cli-service-templates

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

https://github.com/apache/incubator-ariatosca/pull/128.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 #128


commit 0a3ea7991d6218438318d93232f82e7d7d42d4ae
Author: Avia Efrat 
Date:   2017-05-08T14:45:23Z

ARIA-210 Handle relative paths in CLI service-templates

This was a rather simple change, mainly involving adding absolute path
references.

The problems were only in `service-templates store` and in
`service-templates create-archive`.
`service-templates validate` was not affected.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-210) Relative paths may cause issues in `aria service-templates` commands

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001271#comment-16001271
 ] 

ASF GitHub Bot commented on ARIA-210:
-

GitHub user AviaE opened a pull request:

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

ARIA-210 Handle relative paths in CLI service-templates

This was a rather simple change, mainly involving adding absolute path
references.

The problems were only in `service-templates store` and in
`service-templates create-archive`.
`service-templates validate` was not affected.

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

$ git pull https://github.com/apache/incubator-ariatosca 
ARIA-210-handle-relative-paths-in-cli-service-templates

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

https://github.com/apache/incubator-ariatosca/pull/128.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 #128


commit 0a3ea7991d6218438318d93232f82e7d7d42d4ae
Author: Avia Efrat 
Date:   2017-05-08T14:45:23Z

ARIA-210 Handle relative paths in CLI service-templates

This was a rather simple change, mainly involving adding absolute path
references.

The problems were only in `service-templates store` and in
`service-templates create-archive`.
`service-templates validate` was not affected.




> Relative paths may cause issues in `aria service-templates` commands
> 
>
> Key: ARIA-210
> URL: https://issues.apache.org/jira/browse/ARIA-210
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Avia Efrat
>
> The CLI commands {{aria service-templates store}} and {{aria 
> service-templates create-archive}} use the {{os.path.dirname}} method to get 
> the directory of the main service-template file.
> In the former ({{store}} command) this causes errors when the user is already 
> in the directory of the main service-template file and passes the file 
> directly (e.g. {{aria service-templates store service-template.yaml 
> my-service-template}})) - It'll fail when trying to copy the 
> service-template's resources like so:
> {{cannot copy tree '': not a directory}}
> In the latter ({{create-archive}}), any relative path usage will result in an 
> error claiming the file does not exist.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-210) Relative paths may cause issues in `aria service-templates` commands

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001241#comment-16001241
 ] 

ASF subversion and git services commented on ARIA-210:
--

Commit 0a3ea7991d6218438318d93232f82e7d7d42d4ae in incubator-ariatosca's branch 
refs/heads/ARIA-210-handle-relative-paths-in-cli-service-templates from [~avia]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=0a3ea79 ]

ARIA-210 Handle relative paths in CLI service-templates

This was a rather simple change, mainly involving adding absolute path
references.

The problems were only in `service-templates store` and in
`service-templates create-archive`.
`service-templates validate` was not affected.


> Relative paths may cause issues in `aria service-templates` commands
> 
>
> Key: ARIA-210
> URL: https://issues.apache.org/jira/browse/ARIA-210
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>
> The CLI commands {{aria service-templates store}} and {{aria 
> service-templates create-archive}} use the {{os.path.dirname}} method to get 
> the directory of the main service-template file.
> In the former ({{store}} command) this causes errors when the user is already 
> in the directory of the main service-template file and passes the file 
> directly (e.g. {{aria service-templates store service-template.yaml 
> my-service-template}})) - It'll fail when trying to copy the 
> service-template's resources like so:
> {{cannot copy tree '': not a directory}}
> In the latter ({{create-archive}}), any relative path usage will result in an 
> error claiming the file does not exist.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


incubator-ariatosca git commit: ARIA-210 Handle relative paths in CLI service-templates

2017-05-08 Thread avia
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-210-handle-relative-paths-in-cli-service-templates [created] 
0a3ea7991


ARIA-210 Handle relative paths in CLI service-templates

This was a rather simple change, mainly involving adding absolute path
references.

The problems were only in `service-templates store` and in
`service-templates create-archive`.
`service-templates validate` was not affected.


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

Branch: refs/heads/ARIA-210-handle-relative-paths-in-cli-service-templates
Commit: 0a3ea7991d6218438318d93232f82e7d7d42d4ae
Parents: 0ec2370
Author: Avia Efrat 
Authored: Mon May 8 17:45:23 2017 +0300
Committer: Avia Efrat 
Committed: Mon May 8 17:45:23 2017 +0300

--
 aria/cli/commands/service_templates.py |  4 +++-
 aria/cli/csar.py   | 14 --
 aria/cli/service_template_utils.py |  2 +-
 3 files changed, 12 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/0a3ea799/aria/cli/commands/service_templates.py
--
diff --git a/aria/cli/commands/service_templates.py 
b/aria/cli/commands/service_templates.py
index 2537012..460d6cb 100644
--- a/aria/cli/commands/service_templates.py
+++ b/aria/cli/commands/service_templates.py
@@ -195,7 +195,9 @@ def create_archive(service_template_path, destination, 
logger):
 `destination` is the path of the output CSAR archive file
 """
 logger.info('Creating a CSAR archive')
-csar.write(os.path.dirname(service_template_path), service_template_path, 
destination, logger)
+if not destination.endswith('.csar'):
+destination += '.csar'
+csar.write(service_template_path, destination, logger)
 logger.info('CSAR archive created at {0}'.format(destination))
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/0a3ea799/aria/cli/csar.py
--
diff --git a/aria/cli/csar.py b/aria/cli/csar.py
index 5bc35ac..f1608cd 100644
--- a/aria/cli/csar.py
+++ b/aria/cli/csar.py
@@ -38,17 +38,19 @@ BASE_METADATA = {
 }
 
 
-def write(source, entry, destination, logger):
-source = os.path.expanduser(source)
-destination = os.path.expanduser(destination)
-entry_definitions = os.path.join(source, entry)
+def write(service_template_path, destination, logger):
+
+service_template_path = 
os.path.abspath(os.path.expanduser(service_template_path))
+source = os.path.dirname(service_template_path)
+entry = os.path.basename(service_template_path)
+
 meta_file = os.path.join(source, META_FILE)
 if not os.path.isdir(source):
 raise ValueError('{0} is not a directory. Please specify the service 
template '
  'directory.'.format(source))
-if not os.path.isfile(entry_definitions):
+if not os.path.isfile(service_template_path):
 raise ValueError('{0} does not exists. Please specify a valid entry 
point.'
- .format(entry_definitions))
+ .format(service_template_path))
 if os.path.exists(destination):
 raise ValueError('{0} already exists. Please provide a path to where 
the CSAR should be '
  'created.'.format(destination))

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/0a3ea799/aria/cli/service_template_utils.py
--
diff --git a/aria/cli/service_template_utils.py 
b/aria/cli/service_template_utils.py
index 382cce1..c953c02 100644
--- a/aria/cli/service_template_utils.py
+++ b/aria/cli/service_template_utils.py
@@ -53,7 +53,7 @@ def get(source, service_template_filename):
 return _get_service_template_file_from_archive(source, 
service_template_filename)
 else:
 # Maybe check if yaml.
-return source
+return os.path.abspath(source)
 elif len(source.split('/')) == 2:
 url = _map_to_github_url(source)
 downloaded_file = utils.download_file(url)



[jira] [Assigned] (ARIA-210) Relative paths may cause issues in `aria service-templates` commands

2017-05-08 Thread Avia Efrat (JIRA)

 [ 
https://issues.apache.org/jira/browse/ARIA-210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Avia Efrat reassigned ARIA-210:
---

Assignee: Avia Efrat

> Relative paths may cause issues in `aria service-templates` commands
> 
>
> Key: ARIA-210
> URL: https://issues.apache.org/jira/browse/ARIA-210
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Avia Efrat
>
> The CLI commands {{aria service-templates store}} and {{aria 
> service-templates create-archive}} use the {{os.path.dirname}} method to get 
> the directory of the main service-template file.
> In the former ({{store}} command) this causes errors when the user is already 
> in the directory of the main service-template file and passes the file 
> directly (e.g. {{aria service-templates store service-template.yaml 
> my-service-template}})) - It'll fail when trying to copy the 
> service-template's resources like so:
> {{cannot copy tree '': not a directory}}
> In the latter ({{create-archive}}), any relative path usage will result in an 
> error claiming the file does not exist.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


incubator-ariatosca git commit: Fixes due to code review

2017-05-08 Thread emblemparade
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-140-version-utils 7351bfc1d -> 658da4eb7


Fixes due to code review


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

Branch: refs/heads/ARIA-140-version-utils
Commit: 658da4eb77af42a5870351084d4b70b562fb7849
Parents: 7351bfc
Author: Tal Liron 
Authored: Mon May 8 11:19:59 2017 -0500
Committer: Tal Liron 
Committed: Mon May 8 11:19:59 2017 -0500

--
 aria/utils/versions.py   |  4 ++--
 tests/utils/test_versions.py | 13 +++--
 2 files changed, 13 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/658da4eb/aria/utils/versions.py
--
diff --git a/aria/utils/versions.py b/aria/utils/versions.py
index d112c7c..7d94442 100644
--- a/aria/utils/versions.py
+++ b/aria/utils/versions.py
@@ -94,7 +94,7 @@ def parse_version_string(version): # pylint: 
disable=too-many-branches
 version = unicode(version)
 
 # Split to primary and qualifier on '-'
-split = version.split('-', 2)
+split = version.rsplit('-', 1)
 if len(split) == 2:
 primary, qualifier = split
 else:
@@ -126,7 +126,7 @@ def parse_version_string(version): # pylint: 
disable=too-many-branches
 # Parse qualifier
 if qualifier is not None:
 if _DIGITS_RE.match(qualifier) is not None:
-# Integer qualifer
+# Integer qualifier
 try:
 qualifier = float(int(qualifier))
 except ValueError:

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/658da4eb/tests/utils/test_versions.py
--
diff --git a/tests/utils/test_versions.py b/tests/utils/test_versions.py
index 94f632b..222949c 100644
--- a/tests/utils/test_versions.py
+++ b/tests/utils/test_versions.py
@@ -13,10 +13,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-from aria.utils.versions import VersionString
+from aria.utils.versions import (VersionString, parse_version_string)
 
 
-def test_versions():
+def test_version_string():
 # No qualifiers
 assert VersionString('20') == VersionString('20')
 assert VersionString('20') == VersionString('20.0')
@@ -74,3 +74,12 @@ def test_versions():
 # Dicts
 the_dict = {v1: 'test'}
 assert the_dict.get(v2) == 'test'
+
+def test_parse_version_string():
+# One test of each type from the groups above should be enough
+assert parse_version_string('20') < parse_version_string('20.0.1')
+assert parse_version_string('20.0.1-1') < parse_version_string('20.0.1-2')
+assert parse_version_string('20.0.1-beta1') < 
parse_version_string('20.0.1-beta2')
+assert parse_version_string('20.0.0') == parse_version_string(10 * 2)
+assert parse_version_string(None) == parse_version_string(0)
+assert parse_version_string(None) == parse_version_string('maxim is maxim')



[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001019#comment-16001019
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115289497
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
--- End diff --

Because "Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" > "1.1-beta1". The qualifier is a float that is an 
extra, but if the qualifier is not present "infinity" should always win over 
it. It shouldn't matter what's "more natural" seeming: this is an underscored 
internal var that's never seen by users of the lib. Users instead use 
`VersionString.NULL` or can init `VersionString` with None.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001012#comment-16001012
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115289271
  
--- Diff: aria/modeling/service_template.py ---
@@ -2131,13 +2132,15 @@ def resolve(self, model_storage):
 # moved to.
 plugins = model_storage.plugin.list()
 matching_plugins = []
-for plugin in plugins:
-# TODO: we need to use a version comparator
-if (plugin.name == self.name) and \
-((self.version is None) or (plugin.package_version >= 
self.version)):
-matching_plugins.append(plugin)
+if plugins:
+for plugin in plugins:
+if (plugin.name == self.name) and \
--- End diff --

I strongly disagree, especially in this case when there is `or` and `and` 
in the same clause. Do you otherwise expect the reader to know the priority of 
logical binary operations? Parentheses remove any potential confusion.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001014#comment-16001014
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on the issue:

https://github.com/apache/incubator-ariatosca/pull/100
  
Responses.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115289497
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
--- End diff --

Because "Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" > "1.1-beta1". The qualifier is a float that is an 
extra, but if the qualifier is not present "infinity" should always win over 
it. It shouldn't matter what's "more natural" seeming: this is an underscored 
internal var that's never seen by users of the lib. Users instead use 
`VersionString.NULL` or can init `VersionString` with None.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001016#comment-16001016
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115289404
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
--- End diff --

This is a user-exposed function and None values do occur in the wild.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115289404
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
--- End diff --

This is a user-exposed function and None values do occur in the wild.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115289426
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
+return _NULL
+version = unicode(version)
--- End diff --

It is true, there is no tests for this function specifically with a None 
value. I will add it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001018#comment-16001018
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115289426
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
+return _NULL
+version = unicode(version)
--- End diff --

It is true, there is no tests for this function specifically with a None 
value. I will add it.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115289271
  
--- Diff: aria/modeling/service_template.py ---
@@ -2131,13 +2132,15 @@ def resolve(self, model_storage):
 # moved to.
 plugins = model_storage.plugin.list()
 matching_plugins = []
-for plugin in plugins:
-# TODO: we need to use a version comparator
-if (plugin.name == self.name) and \
-((self.version is None) or (plugin.package_version >= 
self.version)):
-matching_plugins.append(plugin)
+if plugins:
+for plugin in plugins:
+if (plugin.name == self.name) and \
--- End diff --

I strongly disagree, especially in this case when there is `or` and `and` 
in the same clause. Do you otherwise expect the reader to know the priority of 
logical binary operations? Parentheses remove any potential confusion.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-ariatosca issue #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on the issue:

https://github.com/apache/incubator-ariatosca/pull/100
  
Responses.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001011#comment-16001011
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115288925
  
--- Diff: aria/modeling/service_template.py ---
@@ -33,7 +33,8 @@
 from ..parser import validation
 from ..parser.consumption import ConsumptionContext
 from ..parser.reading import deepcopy_with_locators
-from ..utils import collections, formatting, console
+from ..utils import (collections, formatting, console)
--- End diff --

We have discussed this and have agreed that it can be in one line if it 
fits. We have a lot of code that is like this.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115288925
  
--- Diff: aria/modeling/service_template.py ---
@@ -33,7 +33,8 @@
 from ..parser import validation
 from ..parser.consumption import ConsumptionContext
 from ..parser.reading import deepcopy_with_locators
-from ..utils import collections, formatting, console
+from ..utils import (collections, formatting, console)
--- End diff --

We have discussed this and have agreed that it can be in one line if it 
fits. We have a lot of code that is like this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001010#comment-16001010
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115288664
  
--- Diff: aria/modeling/service_template.py ---
@@ -33,7 +33,8 @@
 from ..parser import validation
--- End diff --

I don't understand. What does this have to do with this line in the code? 
Where in the commit message? We have limited our commit messages to one line 
with reference to the JIRA for more information. I know you tend to add more 
info, but the rest of us don't normally.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115288664
  
--- Diff: aria/modeling/service_template.py ---
@@ -33,7 +33,8 @@
 from ..parser import validation
--- End diff --

I don't understand. What does this have to do with this line in the code? 
Where in the commit message? We have limited our commit messages to one line 
with reference to the JIRA for more information. I know you tend to add more 
info, but the rest of us don't normally.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001007#comment-16001007
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115288142
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
+return _NULL
+version = unicode(version)
+
+# Split to primary and qualifier on '-'
+split = version.split('-', 2)
+if len(split) == 2:
+primary, qualifier = split
+else:
+primary = split[0]
+qualifier = None
+
+# Parse primary
+split = primary.split('.')
+primary = []
+for element in split:
+if _DIGITS_RE.match(element) is None:
+# Invalid version string
+return _NULL
+try:
+element = int(element)
+except ValueError:
+# Invalid version string
+return _NULL
+primary.append(element)
+
+# Remove redundant zeros
+for element in reversed(primary):
+if element == 0:
+primary.pop()
+else:
+break
+primary = tuple(primary)
+
+# Parse qualifier
+if qualifier is not None:
+if _DIGITS_RE.match(qualifier) is not None:
+# Integer qualifer
+try:
+qualifier = float(int(qualifier))
  

[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115288142
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
+return _NULL
+version = unicode(version)
+
+# Split to primary and qualifier on '-'
+split = version.split('-', 2)
+if len(split) == 2:
+primary, qualifier = split
+else:
+primary = split[0]
+qualifier = None
+
+# Parse primary
+split = primary.split('.')
+primary = []
+for element in split:
+if _DIGITS_RE.match(element) is None:
+# Invalid version string
+return _NULL
+try:
+element = int(element)
+except ValueError:
+# Invalid version string
+return _NULL
+primary.append(element)
+
+# Remove redundant zeros
+for element in reversed(primary):
+if element == 0:
+primary.pop()
+else:
+break
+primary = tuple(primary)
+
+# Parse qualifier
+if qualifier is not None:
+if _DIGITS_RE.match(qualifier) is not None:
+# Integer qualifer
+try:
+qualifier = float(int(qualifier))
+except ValueError:
+# Invalid version string
+return _NULL
+else:
+# Prefixed integer qualifier
+value = None
+

[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16001006#comment-16001006
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115287946
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
+return _NULL
+version = unicode(version)
+
+# Split to primary and qualifier on '-'
+split = version.split('-', 2)
+if len(split) == 2:
+primary, qualifier = split
+else:
+primary = split[0]
+qualifier = None
+
+# Parse primary
+split = primary.split('.')
+primary = []
+for element in split:
+if _DIGITS_RE.match(element) is None:
+# Invalid version string
+return _NULL
+try:
--- End diff --

Maybe it's too many digits for the current Python platform's size of int? 
Seems to me that it's best not to assume it would always work. Utility methods 
need to be especially robust.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of 

[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115287946
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
+return _NULL
+version = unicode(version)
+
+# Split to primary and qualifier on '-'
+split = version.split('-', 2)
+if len(split) == 2:
+primary, qualifier = split
+else:
+primary = split[0]
+qualifier = None
+
+# Parse primary
+split = primary.split('.')
+primary = []
+for element in split:
+if _DIGITS_RE.match(element) is None:
+# Invalid version string
+return _NULL
+try:
--- End diff --

Maybe it's too many digits for the current Python platform's size of int? 
Seems to me that it's best not to assume it would always work. Utility methods 
need to be especially robust.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000985#comment-16000985
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115285799
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
+return _NULL
+version = unicode(version)
+
+# Split to primary and qualifier on '-'
+split = version.split('-', 2)
+if len(split) == 2:
+primary, qualifier = split
+else:
--- End diff --

Oops, yes, changed to rsplit on 1.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115285799
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
+return _NULL
+version = unicode(version)
+
+# Split to primary and qualifier on '-'
+split = version.split('-', 2)
+if len(split) == 2:
+primary, qualifier = split
+else:
--- End diff --

Oops, yes, changed to rsplit on 1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


ARIA TOSCA Presentation at OpenStack Summit Boston

2017-05-08 Thread Arthur Berezin
Hi Guys,

Here are the slides from the ARIA-TOSCA Talk we are doing at OpenStack
Summit Boston
https://docs.google.com/presentation/d/1PemGjFnEh-5QJUy_D1Mz4rHEL7kxdGD9XMc4RQsr6Zo/edit?usp=sharing



Arthur


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000958#comment-16000958
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115282963
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
+return _NULL
+version = unicode(version)
--- End diff --

It is true, there is no test for this function specifically with a None 
value. I will add it.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115282963
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
+return _NULL
+version = unicode(version)
--- End diff --

It is true, there is no test for this function specifically with a None 
value. I will add it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000954#comment-16000954
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115281803
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
--- End diff --

Because "Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" > "1.1-beta1". The qualifier is a float that is an 
extra, but if the qualifier is not present "infinity" should always win over 
it. It shouldn't matter what's "more natural" seeming: this is an underscored 
internal var that's never seen by users of the lib. Users instead use 
`VersionString.NULL` or can init `VersionString` with None.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115281803
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
--- End diff --

Because "Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" > "1.1-beta1". The qualifier is a float that is an 
extra, but if the qualifier is not present "infinity" should always win over 
it. It shouldn't matter what's "more natural" seeming: this is an underscored 
internal var that's never seen by users of the lib. Users instead use 
`VersionString.NULL` or can init `VersionString` with None.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115281656
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
+
+_DIGITS_RE = re.compile(r'^\d+$')
+
+_PREFIXES = {
+'dev':   0.0001,
+'alpha': 0.001,
+'beta':  0.01,
+'rc':0.1
+}
+
+
+class VersionString(unicode):
+"""
+Version string that can be compared, sorted, made unique in a set, and 
used as a unique dict
+key.
+
+The primary part of the string is one or more dot-separated natural 
numbers. Trailing zeroes
+are treated as redundant, e.g. "1.0.0" == "1.0" == "1".
+
+An optional qualifier can be added after a "-". The qualifier can be a 
natural number or a
+specially treated prefixed natural number, e.g. "1.1-beta1" > 
"1.1-alpha2". The case of the
+prefix is ignored.
+
+Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" >
+"1.1-beta1".
+
+Versions without a qualifier will always be greater than their 
equivalents with a qualifier,
+e.g. e.g. "1.1" > "1.1-1".
+
+Any value that does not conform to this format will be treated as a 
zero version, which would
+be lesser than any non-zero version.
+
+For efficient list sorts use the ``key`` property, e.g.:
+``sorted(versions, key=lambda x: x.key)``
+"""
+
+NULL = None # initialized below
+
+def __init__(self, value=None):
+if value is not None:
+super(VersionString, self).__init__(value)
+self.key = parse_version_string(self)
+
+def __eq__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key == version.key
+
+def __lt__(self, version):
+if not isinstance(version, VersionString):
+version = VersionString(version)
+return self.key < version.key
+
+def __hash__(self):
+return self.key.__hash__()
+
+
+def parse_version_string(version): # pylint: disable=too-many-branches
+"""
+Parses a version string.
+
+:param version: The version string
+:returns: The primary tuple and qualifier float
+:rtype: ((int), float)
+"""
+
+if version is None:
--- End diff --

Already in line #64 do you see the default to be None. But anyway, this is 
a user-exposed function and None values do occur in the wild.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-140) General purpose version comparison

2017-05-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000943#comment-16000943
 ] 

ASF GitHub Bot commented on ARIA-140:
-

Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115281253
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
--- End diff --

Because "Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" > "1.1-beta1". The qualifier is a float that is an 
extra, but if the qualifier is not present "infinity" should always win over 
it. It shouldn't matter what's "more natural" seeming: this is an underscored 
internal var that's never seen by users of the lib.


> General purpose version comparison
> --
>
> Key: ARIA-140
> URL: https://issues.apache.org/jira/browse/ARIA-140
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Tal Liron
>Assignee: Tal Liron
>Priority: Minor
>
> Add {{aria.utils.versions}} to allow for general-purpose comparison and 
> sorting of version strings.
> For now this will be used for resolving plugin specifications to plugins, but 
> it may very well have other uses in the future.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[GitHub] incubator-ariatosca pull request #100: ARIA-140 Version utils

2017-05-08 Thread tliron
Github user tliron commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/100#discussion_r115281253
  
--- Diff: aria/utils/versions.py ---
@@ -0,0 +1,162 @@
+# 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.
+
+"""
+General-purpose version string handling
+"""
+
+import re
+
+
+_INF = float('inf')
+
+_NULL = (), _INF
--- End diff --

Because "Numeric qualifiers will always be greater than prefixed integer 
qualifiers, e.g. "1.1-1" > "1.1-beta1". The qualifier is a float that is an 
extra, but if the qualifier is not present "infinity" should always win over 
it. It shouldn't matter what's "more natural" seeming: this is an underscored 
internal var that's never seen by users of the lib.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (ARIA-165) Make node name suffix UUIDs become more readable

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000838#comment-16000838
 ] 

ASF subversion and git services commented on ARIA-165:
--

Commit 6c25143c1f0420935892a3d5a5afd3dc28088d07 in incubator-ariatosca's branch 
refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable from 
[~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=6c25143 ]

ARIA-165 Make node name suffix UUIDs become more readable


> Make node name suffix UUIDs become more readable
> 
>
> Key: ARIA-165
> URL: https://issues.apache.org/jira/browse/ARIA-165
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
>
> Node names are currently constructed of the node template name with a UUID 
> suffix. While this makes the node name unique across all services, it also 
> makes the node names less readable, and since nodes are already unique via 
> their ID, it might be better to use a different type of suffix.
> One option would be to generate a shorter, no capital letters string, which 
> would be more readable, and (in very high probability) unique in a single 
> service.
> Another option would be to go for a running number suffix for each node of a 
> given node template, which could be simple, unique and readable.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


incubator-ariatosca git commit: ARIA-165 Make node name suffix UUIDs become more readable [Forced Update!]

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable 
51480d500 -> 6c25143c1 (forced update)


ARIA-165 Make node name suffix UUIDs become more readable


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

Branch: refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable
Commit: 6c25143c1f0420935892a3d5a5afd3dc28088d07
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 15:25:37 2017 +0300
Committer: max-orlov 
Committed: Mon May 8 17:39:56 2017 +0300

--
 aria/modeling/service_template.py | 3 +--
 aria/parser/modeling/context.py   | 5 -
 2 files changed, 1 insertion(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/6c25143c/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7fab4fc..4663971 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -549,9 +549,8 @@ class NodeTemplateBase(TemplateModelMixin):
 ('requirement_templates', 
formatting.as_raw_list(self.requirement_templates
 
 def instantiate(self, container):
-context = ConsumptionContext.get_thread_local()
 from . import models
-name = context.modeling.generate_node_id(self.name)
+name = '{name}.{index}'.format(name=self.name, index=len(self.nodes))
 node = models.Node(name=name,
type=self.type,

description=deepcopy_with_locators(self.description),

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/6c25143c/aria/parser/modeling/context.py
--
diff --git a/aria/parser/modeling/context.py b/aria/parser/modeling/context.py
index dff5991..4a53641 100644
--- a/aria/parser/modeling/context.py
+++ b/aria/parser/modeling/context.py
@@ -67,11 +67,6 @@ class ModelingContext(object):
 if self.instance is not None:
 model_storage.service.put(self.instance)
 
-def generate_node_id(self, template_name):
-return self.node_id_format.format(
-template=template_name,
-id=self.generate_id())
-
 def generate_id(self):
 if self.id_type == IdType.LOCAL_SERIAL:
 return self._serial_id_counter.next()



[jira] [Reopened] (ARIA-160) Operation toolbelt unit tests fail spordically

2017-05-08 Thread Maxim Orlov (JIRA)

 [ 
https://issues.apache.org/jira/browse/ARIA-160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maxim Orlov reopened ARIA-160:
--

> Operation toolbelt unit tests fail spordically
> --
>
> Key: ARIA-160
> URL: https://issues.apache.org/jira/browse/ARIA-160
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
> Fix For: 0.1.0
>
>
> The unit tests in the module {{test_toolbelt.py}} fail remote builds 
> (TravisCI, Jenkins) sporadically.
> Stack trace:
> {code}
> workflow_context = WorkflowContext(deployment_id=1, 
> workflow_name=test_workflow, execution_id=1)
> executor =  at 0x7f57f8482a50>
> def test_host_ip(workflow_context, executor):
> interface_name = 'Standard'
> operation_name = 'create'
> _, dependency_node, _, _, _ = _get_elements(workflow_context)
> inputs = {'putput': True}
> interface = mock.models.create_interface(
> dependency_node.service,
> interface_name=interface_name,
> operation_name=operation_name,
> operation_kwargs=dict(implementation=op_path(host_ip, 
> module_path=__name__),
>   inputs=inputs)
> )
> dependency_node.interfaces[interface.name] = interface
> workflow_context.model.node.update(dependency_node)
> 
> @workflow
> def basic_workflow(graph, **_):
> graph.add_tasks(
> api.task.OperationTask.for_node(
> node=dependency_node,
> interface_name=interface_name,
> operation_name=operation_name,
> inputs=inputs
> )
> )
> 
> >   execute(workflow_func=basic_workflow, 
> > workflow_context=workflow_context, executor=executor)
> tests/orchestrator/context/test_toolbelt.py:101: 
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> tests/orchestrator/context/__init__.py:29: in execute
> eng.execute()
> aria/orchestrator/workflows/core/engine.py:59: in execute
> for task in self._ended_tasks():
> aria/orchestrator/workflows/core/engine.py:96: in 
> return (task for task in self._tasks_iter() if task.has_ended())
> aria/orchestrator/workflows/core/task.py:259: in __getattr__
> return getattr(self.model_task, attr)
> aria/orchestrator/workflows/core/task.py:178: in model_task
> return self._workflow_context.model.task.get(self._task_id)
> aria/storage/sql_mapi.py:59: in get
> result = query.first()
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2731: in first
> ret = list(self[0:1])
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2523: in 
> __getitem__
> return list(res)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2831: in 
> __iter__
> return self._execute_and_instances(context)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/orm/query.py:2854: in 
> _execute_and_instances
> result = conn.execute(querycontext.statement, self._params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:945: in 
> execute
> return meth(self, multiparams, params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/sql/elements.py:263: in 
> _execute_on_connection
> return connection._execute_clauseelement(self, multiparams, params)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1053: in 
> _execute_clauseelement
> compiled_sql, distilled_params
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1189: in 
> _execute_context
> context)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1393: in 
> _handle_dbapi_exception
> exc_info
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/util/compat.py:203: in 
> raise_from_cause
> reraise(type(exception), exception, tb=exc_tb, cause=cause)
> .tox/py27/lib/python2.7/site-packages/sqlalchemy/engine/base.py:1182: in 
> _execute_context
> context)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
> _ 
> self =  0x7f57f97ee250>
> cursor = 
> statement = 'SELECT task.id AS task_id, task.name AS task_name, 
> task.implementation AS task_implementation, task.max_attempts AS t..._fk AS 
> task_execution_fk, task.relationship_fk AS task_relationship_fk 
> FROM task 
> WHERE task.id = ?
>  LIMIT ? OFFSET ?'
> parameters = (1, 1, 0)
> context =  0x7f57f83b1810>
> def do_execute(self, cursor, statement, parameters, context=None):
> >   cursor.execute(statement, parameters)
> E   InterfaceError: (sqlite3.InterfaceError) Error binding parameter 0 - 
> probably unsupported type. [SQL: u'SELECT task.id AS task_id, task.name AS 
> task_name, task.implementation AS 

[jira] [Commented] (ARIA-165) Make node name suffix UUIDs become more readable

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000827#comment-16000827
 ] 

ASF subversion and git services commented on ARIA-165:
--

Commit 51480d500423ba79c0321b0f55fea469407f5c4c in incubator-ariatosca's branch 
refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable from 
[~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=51480d5 ]

ARIA-165 Make node name suffix UUIDs become more readable


> Make node name suffix UUIDs become more readable
> 
>
> Key: ARIA-165
> URL: https://issues.apache.org/jira/browse/ARIA-165
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
>
> Node names are currently constructed of the node template name with a UUID 
> suffix. While this makes the node name unique across all services, it also 
> makes the node names less readable, and since nodes are already unique via 
> their ID, it might be better to use a different type of suffix.
> One option would be to generate a shorter, no capital letters string, which 
> would be more readable, and (in very high probability) unique in a single 
> service.
> Another option would be to go for a running number suffix for each node of a 
> given node template, which could be simple, unique and readable.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-165) Make node name suffix UUIDs become more readable

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000821#comment-16000821
 ] 

ASF subversion and git services commented on ARIA-165:
--

Commit 8cbf11d6d4f7a3b77ed2421e05b2fce47efb5b36 in incubator-ariatosca's branch 
refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable from 
[~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=8cbf11d ]

ARIA-165 Make node name suffix UUIDs become more readable


> Make node name suffix UUIDs become more readable
> 
>
> Key: ARIA-165
> URL: https://issues.apache.org/jira/browse/ARIA-165
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
>
> Node names are currently constructed of the node template name with a UUID 
> suffix. While this makes the node name unique across all services, it also 
> makes the node names less readable, and since nodes are already unique via 
> their ID, it might be better to use a different type of suffix.
> One option would be to generate a shorter, no capital letters string, which 
> would be more readable, and (in very high probability) unique in a single 
> service.
> Another option would be to go for a running number suffix for each node of a 
> given node template, which could be simple, unique and readable.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (ARIA-230) Dry execution doesn't log empty operations

2017-05-08 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000818#comment-16000818
 ] 

ASF subversion and git services commented on ARIA-230:
--

Commit 10d320a578b7da4068d8db7e1073693f6d58616d in incubator-ariatosca's branch 
refs/heads/ARIA-230-Dry-execution-doesnt-log-empty-operations from [~Mxmrlv]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=10d320a ]

ARIA-230 Dry execution doesn't log empty operations


> Dry execution doesn't log empty operations
> --
>
> Key: ARIA-230
> URL: https://issues.apache.org/jira/browse/ARIA-230
> Project: AriaTosca
>  Issue Type: Bug
>Affects Versions: 0.1.0
>Reporter: Maxim Orlov
>Assignee: Maxim Orlov
>
> Dry execution doesn't log empty operations



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


incubator-ariatosca git commit: ARIA-165 Make node name suffix UUIDs become more readable [Forced Update!]

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable 
8cbf11d6d -> 51480d500 (forced update)


ARIA-165 Make node name suffix UUIDs become more readable


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

Branch: refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable
Commit: 51480d500423ba79c0321b0f55fea469407f5c4c
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 15:25:37 2017 +0300
Committer: max-orlov 
Committed: Mon May 8 17:30:46 2017 +0300

--
 aria/modeling/service_template.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/51480d50/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7fab4fc..4663971 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -549,9 +549,8 @@ class NodeTemplateBase(TemplateModelMixin):
 ('requirement_templates', 
formatting.as_raw_list(self.requirement_templates
 
 def instantiate(self, container):
-context = ConsumptionContext.get_thread_local()
 from . import models
-name = context.modeling.generate_node_id(self.name)
+name = '{name}.{index}'.format(name=self.name, index=len(self.nodes))
 node = models.Node(name=name,
type=self.type,

description=deepcopy_with_locators(self.description),



incubator-ariatosca git commit: ARIA-165 Make node name suffix UUIDs become more readable [Forced Update!]

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable 
991fb6bd2 -> 8cbf11d6d (forced update)


ARIA-165 Make node name suffix UUIDs become more readable


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

Branch: refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable
Commit: 8cbf11d6d4f7a3b77ed2421e05b2fce47efb5b36
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 15:25:37 2017 +0300
Committer: max-orlov 
Committed: Mon May 8 17:29:54 2017 +0300

--
 aria/modeling/service_template.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/8cbf11d6/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7fab4fc..5e4b661 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -549,9 +549,8 @@ class NodeTemplateBase(TemplateModelMixin):
 ('requirement_templates', 
formatting.as_raw_list(self.requirement_templates
 
 def instantiate(self, container):
-context = ConsumptionContext.get_thread_local()
 from . import models
-name = context.modeling.generate_node_id(self.name)
+name = '{name}.{index}'.format(name=self.name, index=len(self.nodes))
 node = models.Node(name=name,
type=self.type,

description=deepcopy_with_locators(self.description),
@@ -562,6 +561,7 @@ class NodeTemplateBase(TemplateModelMixin):
 utils.instantiate_dict(node, node.interfaces, self.interface_templates)
 utils.instantiate_dict(node, node.artifacts, self.artifact_templates)
 utils.instantiate_dict(node, node.capabilities, 
self.capability_templates)
+import pydevd; pydevd.settrace('localhost', suspend=False)
 return node
 
 def validate(self):



incubator-ariatosca git commit: ARIA-230 Dry execution doesn't log empty operations

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-230-Dry-execution-doesnt-log-empty-operations [created] 
10d320a57


ARIA-230 Dry execution doesn't log empty operations


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

Branch: refs/heads/ARIA-230-Dry-execution-doesnt-log-empty-operations
Commit: 10d320a578b7da4068d8db7e1073693f6d58616d
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 17:29:29 2017 +0300
Committer: max-orlov 
Committed: Mon May 8 17:29:29 2017 +0300

--
 aria/orchestrator/workflows/executor/dry.py | 26 
 1 file changed, 13 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/10d320a5/aria/orchestrator/workflows/executor/dry.py
--
diff --git a/aria/orchestrator/workflows/executor/dry.py 
b/aria/orchestrator/workflows/executor/dry.py
index f6fb7a6..63ec392 100644
--- a/aria/orchestrator/workflows/executor/dry.py
+++ b/aria/orchestrator/workflows/executor/dry.py
@@ -32,20 +32,20 @@ class DryExecutor(BaseExecutor):
 task.started_at = datetime.utcnow()
 task.status = task.STARTED
 
+dry_msg = ' {name} {task.interface_name}.{task.operation_name} 
{suffix}'
+logger = task.context.logger.info if task.implementation else 
task.context.logger.debug
+
+if hasattr(task.actor, 'source_node'):
+name = '{source_node.name}->{target_node.name}'.format(
+source_node=task.actor.source_node, 
target_node=task.actor.target_node)
+else:
+name = task.actor.name
+
 if task.implementation:
-if hasattr(task.actor, 'source_node'):
-name = '{source_node.name}->{target_node.name}'.format(
-source_node=task.actor.source_node, 
target_node=task.actor.target_node)
-else:
-name = task.actor.name
-
-task.context.logger.info(
-' {name} {task.interface_name}.{task.operation_name} 
started...'
-.format(name=name, task=task))
-
-task.context.logger.info(
-' {name} {task.interface_name}.{task.operation_name} 
successful'
-.format(name=name, task=task))
+logger(dry_msg.format(name=name, task=task, suffix='started...'))
+logger(dry_msg.format(name=name, task=task, suffix='successful'))
+else:
+logger(dry_msg.format(name=name, task=task, suffix='has no 
implementation'))
 
 # updating the task manually instead of calling 
self._task_succeeded(task),
 # to avoid any side effects raising that event might cause



[jira] [Created] (ARIA-230) Dry execution doesn't log empty operations

2017-05-08 Thread Maxim Orlov (JIRA)
Maxim Orlov created ARIA-230:


 Summary: Dry execution doesn't log empty operations
 Key: ARIA-230
 URL: https://issues.apache.org/jira/browse/ARIA-230
 Project: AriaTosca
  Issue Type: Bug
Affects Versions: 0.1.0
Reporter: Maxim Orlov
Assignee: Maxim Orlov


Dry execution doesn't log empty operations



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


incubator-ariatosca git commit: wip [Forced Update!]

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable 
a10e6dc68 -> 991fb6bd2 (forced update)


wip


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

Branch: refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable
Commit: 991fb6bd210a916e214573796120aa782d3b81b0
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 15:25:37 2017 +0300
Committer: max-orlov 
Committed: Mon May 8 17:21:07 2017 +0300

--
 aria/modeling/service_template.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/991fb6bd/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7fab4fc..5e4b661 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -549,9 +549,8 @@ class NodeTemplateBase(TemplateModelMixin):
 ('requirement_templates', 
formatting.as_raw_list(self.requirement_templates
 
 def instantiate(self, container):
-context = ConsumptionContext.get_thread_local()
 from . import models
-name = context.modeling.generate_node_id(self.name)
+name = '{name}.{index}'.format(name=self.name, index=len(self.nodes))
 node = models.Node(name=name,
type=self.type,

description=deepcopy_with_locators(self.description),
@@ -562,6 +561,7 @@ class NodeTemplateBase(TemplateModelMixin):
 utils.instantiate_dict(node, node.interfaces, self.interface_templates)
 utils.instantiate_dict(node, node.artifacts, self.artifact_templates)
 utils.instantiate_dict(node, node.capabilities, 
self.capability_templates)
+import pydevd; pydevd.settrace('localhost', suspend=False)
 return node
 
 def validate(self):



[jira] [Commented] (ARIA-165) Make node name suffix UUIDs become more readable

2017-05-08 Thread Maxim Orlov (JIRA)

[ 
https://issues.apache.org/jira/browse/ARIA-165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16000785#comment-16000785
 ] 

Maxim Orlov commented on ARIA-165:
--

We can uitilze the SQLAlcehmy events mechanism, which could automate the name 
composition. However, this mechanism is a bit more complicated as it requires 
better knowledge of sqlalcehmy (and SQL). Example:
http://stackoverflow.com/questions/32277403/how-can-i-create-a-sqlalchemy-column-whose-default-is-to-be-equal-to-the-primary

Another optional fix is the use of the length of the list of the current nodes 
for the relevant node_template. This would enable easy suffices but once a node 
is deleted, a new node could get the old node's name. 
The latter is the current fix for this issue.

> Make node name suffix UUIDs become more readable
> 
>
> Key: ARIA-165
> URL: https://issues.apache.org/jira/browse/ARIA-165
> Project: AriaTosca
>  Issue Type: Story
>Reporter: Ran Ziv
>Assignee: Maxim Orlov
>Priority: Minor
>
> Node names are currently constructed of the node template name with a UUID 
> suffix. While this makes the node name unique across all services, it also 
> makes the node names less readable, and since nodes are already unique via 
> their ID, it might be better to use a different type of suffix.
> One option would be to generate a shorter, no capital letters string, which 
> would be more readable, and (in very high probability) unique in a single 
> service.
> Another option would be to go for a running number suffix for each node of a 
> given node template, which could be simple, unique and readable.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


incubator-ariatosca git commit: wip [Forced Update!]

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable 
aa57ad0b4 -> a10e6dc68 (forced update)


wip


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

Branch: refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable
Commit: a10e6dc68bd13749abfb48b7dc032621a5181f5f
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 15:25:37 2017 +0300
Committer: max-orlov 
Committed: Mon May 8 17:09:02 2017 +0300

--
 aria/modeling/service_template.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/a10e6dc6/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7fab4fc..da83143 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -549,9 +549,8 @@ class NodeTemplateBase(TemplateModelMixin):
 ('requirement_templates', 
formatting.as_raw_list(self.requirement_templates
 
 def instantiate(self, container):
-context = ConsumptionContext.get_thread_local()
 from . import models
-name = context.modeling.generate_node_id(self.name)
+name = '{name}.{index}'.format(self.name, len(self.nodes))
 node = models.Node(name=name,
type=self.type,

description=deepcopy_with_locators(self.description),



incubator-ariatosca git commit: wip [Forced Update!]

2017-05-08 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable 
b9e5fb3c8 -> aa57ad0b4 (forced update)


wip


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

Branch: refs/heads/ARIA-165-Make-node-name-suffix-UUIDs-become-more-readable
Commit: aa57ad0b4a2d1719956118a6774c43f69accdafb
Parents: 0ec2370
Author: max-orlov 
Authored: Mon May 8 15:25:37 2017 +0300
Committer: max-orlov 
Committed: Mon May 8 16:14:20 2017 +0300

--
 aria/modeling/service_instance.py | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/aa57ad0b/aria/modeling/service_instance.py
--
diff --git a/aria/modeling/service_instance.py 
b/aria/modeling/service_instance.py
index ad8e7ed..18c920e 100644
--- a/aria/modeling/service_instance.py
+++ b/aria/modeling/service_instance.py
@@ -20,8 +20,8 @@ from sqlalchemy import (
 Text,
 Integer,
 Enum,
-Boolean
-)
+Boolean,
+FetchedValue, event)
 from sqlalchemy import DateTime
 from sqlalchemy.ext.associationproxy import association_proxy
 from sqlalchemy.ext.declarative import declared_attr
@@ -688,6 +688,17 @@ class NodeBase(InstanceModelMixin):
 utils.dump_dict_values(self.capabilities, 'Capabilities')
 utils.dump_list_values(self.outbound_relationships, 
'Relationships')
 
+# @staticmethod
+# def fill_name(mapper, connection, target):
+# # Creating a trigger which updates the name right after the model is 
created on the
+# # server-side
+# import pydevd;
+# pydevd.settrace('localhost', suspend=False)
+# 
connection.execute(mapper.mapped_table.update().values(name=target.id)).where(
+# NodeBase.c.id == target.id)
+
+# event.listen(NodeBase, 'after_insert', NodeBase.fill_name)
+
 
 class GroupBase(InstanceModelMixin):
 """



[jira] [Created] (ARIA-229) ARIA Configuration

2017-05-08 Thread Ran Ziv (JIRA)
Ran Ziv created ARIA-229:


 Summary: ARIA Configuration
 Key: ARIA-229
 URL: https://issues.apache.org/jira/browse/ARIA-229
 Project: AriaTosca
  Issue Type: Story
Reporter: Ran Ziv
Priority: Trivial


ARIA could benefit from having global configuration which would allow setting 
of default values / resources to be used, thereby decreasing verbosity and 
simplifying usage.

For example, a default private key to use when instantiating VMs on an IaaS 
could be set via this configuration, as well as perhaps the credentials for 
this IaaS.

Another example could be the setting of general execution parameters such as 
the default number of task attempts - Right now it's configurable via the CLI, 
but that's on a per-execution basis, rather than on a per-service or globally 
for all services managed by ARIA.

This global configuration could perhaps be modeled as another table in the 
model-storage.




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Created] (ARIA-228) Add mypy usage in ARIA

2017-05-08 Thread Ran Ziv (JIRA)
Ran Ziv created ARIA-228:


 Summary: Add mypy usage in ARIA
 Key: ARIA-228
 URL: https://issues.apache.org/jira/browse/ARIA-228
 Project: AriaTosca
  Issue Type: Task
Reporter: Ran Ziv
Priority: Trivial


Add {{mypy}} as a dependency of ARIA to allow optional static typing where 
necessary or desired.




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


  1   2   >