Re: New mailing lists

2017-05-15 Thread Matej Artač

Dear all,

I like this proposal. I am an outsider who is interested in the 
activities and progress of your project. It would be really great for me 
if this mailing list would contain what John suggests. I think it would 
greatly improve visibility into your project and likely provide a 
grounds for some additional discussion and comments from a larger community.


Best regards,
Matej


John D. Ament je 15.5.2017 ob 16:12 napisal:

No, and that's sort of the issue at hand here.  I've requested these
mailing list changes because the dev@ traffic is typically github or JIRA
chatter.  We have no on list discussions.  I'm basically trying to force
you guys to actually talk to one another via email, since our other
attempts have not worked out well.

I would expect that Slack discussions are summarized here by those
participating in them.  Not automatically.

John

On Tue, May 9, 2017 at 10:00 PM Arthur Berezin 
wrote:


I missed the Slack chat, but sounds good +1. Is there an easy way to get a
digest of the slack chat over dev mailing list?

On Tue, May 9, 2017, 21:43 John D. Ament  wrote:


All,

Based on a brief chat on Slack, I'm going to go ahead and create two new
mailing lists:

- commits@
- issues@

The reason being, the dev list is designed for developer discussions, but
most of the banter is on JIRA issues or GitHub PRs/commits.  To

effectively

measure the community openness we need to separate the types.

All changes in a JIRA issue will be sent to issues@ and all commits will
go
to commits@.

John



--
Senior researcher
XLAB d.o.o.
Pot za Brdom 100
SI-1000 Ljubljana
Slovenia

DICE project team leader and WP5 leader: http://www.dice-h2020.eu
Member, OASIS TOSCA Standard Technical Committee

URL: http://www.xlab.si/rd/
Live chat: visit http://www.xlab.si/ and click Live chat
Google Drive, hangouts: matej.artac...@gmail.com
Office phone: +386 1 244 77 53



[incubator-ariatosca] Git Push Summary

2017-05-15 Thread avia
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-171-service-template-services-type-inconsistency [deleted] 
24d693d76


incubator-ariatosca git commit: ARIA-171 service_template.services type inconsistency

2017-05-15 Thread avia
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/master fdd57c47a -> 24d693d76


ARIA-171 service_template.services type inconsistency

As opposed to service_template.node_templates and service.nodes
which have a dict interface, service_template.services
had a list interface. That seemed inconsistent, so the former
interface was changed to a dict interface as well.


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

Branch: refs/heads/master
Commit: 24d693d762e4a56d6bf16d8c29d76c1f2909098d
Parents: fdd57c4
Author: Avia Efrat 
Authored: Mon May 15 14:26:34 2017 +0300
Committer: Avia Efrat 
Committed: Tue May 16 00:09:49 2017 +0300

--
 aria/cli/commands/service_templates.py | 4 ++--
 aria/modeling/service_template.py  | 2 +-
 tests/cli/test_service_templates.py| 6 --
 tests/end2end/test_hello_world.py  | 2 +-
 tests/end2end/test_nodecellar.py   | 2 +-
 5 files changed, 9 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/24d693d7/aria/cli/commands/service_templates.py
--
diff --git a/aria/cli/commands/service_templates.py 
b/aria/cli/commands/service_templates.py
index 0a24907..d139195 100644
--- a/aria/cli/commands/service_templates.py
+++ b/aria/cli/commands/service_templates.py
@@ -89,8 +89,8 @@ def show(service_template_name, model_storage, mode_full, 
mode_types, format_jso
 
 if service_template.services:
 logger.info('Existing services:')
-for service in service_template.services:
-logger.info('\t{0}'.format(service.name))
+for service_name in service_template.services:
+logger.info('\t{0}'.format(service_name))
 
 
 @service_templates.command(name='list',

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/24d693d7/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7eb35bd..1eb95a3 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -208,7 +208,7 @@ class ServiceTemplateBase(TemplateModelMixin):
 
 @declared_attr
 def services(cls):
-return relationship.one_to_many(cls, 'service')
+return relationship.one_to_many(cls, 'service', dict_key='name')
 
 @declared_attr
 def operation_templates(cls):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/24d693d7/tests/cli/test_service_templates.py
--
diff --git a/tests/cli/test_service_templates.py 
b/tests/cli/test_service_templates.py
index bc3c751..7e86896 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -65,7 +65,8 @@ class TestServiceTemplatesShow(TestCliBase):
 
 monkeypatch.setattr(_Environment, 'model_storage', mock_storage)
 st = mock_models.create_service_template()
-st.services = [mock_models.create_service(st)]
+s = mock_models.create_service(st)
+st.services = {s.name: s}
 monkeypatch.setattr(mock_storage.service_template, 'get_by_name',
 mock.MagicMock(return_value=st))
 
@@ -79,7 +80,8 @@ class TestServiceTemplatesShow(TestCliBase):
 
 monkeypatch.setattr(_Environment, 'model_storage', mock_storage)
 st = 
mock_models.create_service_template(description='test_description')
-st.services = [mock_models.create_service(st)]
+s = mock_models.create_service(st)
+st.services = {s.name: s}
 monkeypatch.setattr(mock_storage.service_template, 'get_by_name',
 mock.MagicMock(return_value=st))
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/24d693d7/tests/end2end/test_hello_world.py
--
diff --git a/tests/end2end/test_hello_world.py 
b/tests/end2end/test_hello_world.py
index fc5f631..71792dd 100644
--- a/tests/end2end/test_hello_world.py
+++ b/tests/end2end/test_hello_world.py
@@ -52,7 +52,7 @@ 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]
+service = 

incubator-ariatosca git commit: ARIA-171 service_template.services type inconsistency [Forced Update!]

2017-05-15 Thread avia
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-171-service-template-services-type-inconsistency 5760b4e3c -> 
24d693d76 (forced update)


ARIA-171 service_template.services type inconsistency

As opposed to service_template.node_templates and service.nodes
which have a dict interface, service_template.services
had a list interface. That seemed inconsistent, so the former
interface was changed to a dict interface as well.


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

Branch: refs/heads/ARIA-171-service-template-services-type-inconsistency
Commit: 24d693d762e4a56d6bf16d8c29d76c1f2909098d
Parents: fdd57c4
Author: Avia Efrat 
Authored: Mon May 15 14:26:34 2017 +0300
Committer: Avia Efrat 
Committed: Tue May 16 00:09:49 2017 +0300

--
 aria/cli/commands/service_templates.py | 4 ++--
 aria/modeling/service_template.py  | 2 +-
 tests/cli/test_service_templates.py| 6 --
 tests/end2end/test_hello_world.py  | 2 +-
 tests/end2end/test_nodecellar.py   | 2 +-
 5 files changed, 9 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/24d693d7/aria/cli/commands/service_templates.py
--
diff --git a/aria/cli/commands/service_templates.py 
b/aria/cli/commands/service_templates.py
index 0a24907..d139195 100644
--- a/aria/cli/commands/service_templates.py
+++ b/aria/cli/commands/service_templates.py
@@ -89,8 +89,8 @@ def show(service_template_name, model_storage, mode_full, 
mode_types, format_jso
 
 if service_template.services:
 logger.info('Existing services:')
-for service in service_template.services:
-logger.info('\t{0}'.format(service.name))
+for service_name in service_template.services:
+logger.info('\t{0}'.format(service_name))
 
 
 @service_templates.command(name='list',

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/24d693d7/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7eb35bd..1eb95a3 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -208,7 +208,7 @@ class ServiceTemplateBase(TemplateModelMixin):
 
 @declared_attr
 def services(cls):
-return relationship.one_to_many(cls, 'service')
+return relationship.one_to_many(cls, 'service', dict_key='name')
 
 @declared_attr
 def operation_templates(cls):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/24d693d7/tests/cli/test_service_templates.py
--
diff --git a/tests/cli/test_service_templates.py 
b/tests/cli/test_service_templates.py
index bc3c751..7e86896 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -65,7 +65,8 @@ class TestServiceTemplatesShow(TestCliBase):
 
 monkeypatch.setattr(_Environment, 'model_storage', mock_storage)
 st = mock_models.create_service_template()
-st.services = [mock_models.create_service(st)]
+s = mock_models.create_service(st)
+st.services = {s.name: s}
 monkeypatch.setattr(mock_storage.service_template, 'get_by_name',
 mock.MagicMock(return_value=st))
 
@@ -79,7 +80,8 @@ class TestServiceTemplatesShow(TestCliBase):
 
 monkeypatch.setattr(_Environment, 'model_storage', mock_storage)
 st = 
mock_models.create_service_template(description='test_description')
-st.services = [mock_models.create_service(st)]
+s = mock_models.create_service(st)
+st.services = {s.name: s}
 monkeypatch.setattr(mock_storage.service_template, 'get_by_name',
 mock.MagicMock(return_value=st))
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/24d693d7/tests/end2end/test_hello_world.py
--
diff --git a/tests/end2end/test_hello_world.py 
b/tests/end2end/test_hello_world.py
index fc5f631..71792dd 100644
--- a/tests/end2end/test_hello_world.py
+++ b/tests/end2end/test_hello_world.py
@@ -52,7 +52,7 @@ def _verify_deployed_service_in_storage(service_name, 
model_storage):
 service_templates = model_storage.service_template.list()
 assert len(service_templates) == 1
 assert 

Re: New mailing lists

2017-05-15 Thread John D. Ament
No, and that's sort of the issue at hand here.  I've requested these
mailing list changes because the dev@ traffic is typically github or JIRA
chatter.  We have no on list discussions.  I'm basically trying to force
you guys to actually talk to one another via email, since our other
attempts have not worked out well.

I would expect that Slack discussions are summarized here by those
participating in them.  Not automatically.

John

On Tue, May 9, 2017 at 10:00 PM Arthur Berezin 
wrote:

> I missed the Slack chat, but sounds good +1. Is there an easy way to get a
> digest of the slack chat over dev mailing list?
>
> On Tue, May 9, 2017, 21:43 John D. Ament  wrote:
>
> > All,
> >
> > Based on a brief chat on Slack, I'm going to go ahead and create two new
> > mailing lists:
> >
> > - commits@
> > - issues@
> >
> > The reason being, the dev list is designed for developer discussions, but
> > most of the banter is on JIRA issues or GitHub PRs/commits.  To
> effectively
> > measure the community openness we need to separate the types.
> >
> > All changes in a JIRA issue will be sent to issues@ and all commits will
> > go
> > to commits@.
> >
> > John
> >
>


[jira] [Commented] (ARIA-171) Service_template.services type inconsistency

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

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

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

Commit 5760b4e3c06aab91bcc7b9453aa7383d25130a99 in incubator-ariatosca's branch 
refs/heads/ARIA-171-service-template-services-type-inconsistency from [~avia]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=5760b4e ]

ARIA-171 service_template.services type inconsistency

As opposed to service_template.node_templates and service.nodes
which have a dict interface, service_template.services
had a list interface. That seemed as inconsistent, so the former
interface was changed to a dict interface as well.


> Service_template.services type inconsistency
> 
>
> Key: ARIA-171
> URL: https://issues.apache.org/jira/browse/ARIA-171
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Avia Efrat
>
> {{service_template.services}} is an object of type {{InstrumentedList}}, 
> which is inconsistent with similar forms of model access (e.g. 
> {{service.nodes}}).
> The object's type should instead be a {{MappedCollection}} from the service 
> name to the service model object.



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


incubator-ariatosca git commit: ARIA-171 service_template.services type inconsistency [Forced Update!]

2017-05-15 Thread avia
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-171-service-template-services-type-inconsistency 4425c1030 -> 
5760b4e3c (forced update)


ARIA-171 service_template.services type inconsistency

As opposed to service_template.node_templates and service.nodes
which have a dict interface, service_template.services
had a list interface. That seemed as inconsistent, so the former
interface was changed to a dict interface as well.


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

Branch: refs/heads/ARIA-171-service-template-services-type-inconsistency
Commit: 5760b4e3c06aab91bcc7b9453aa7383d25130a99
Parents: fdd57c4
Author: Avia Efrat 
Authored: Mon May 15 14:26:34 2017 +0300
Committer: Avia Efrat 
Committed: Mon May 15 15:20:05 2017 +0300

--
 aria/cli/commands/service_templates.py | 4 ++--
 aria/modeling/service_template.py  | 2 +-
 tests/cli/test_service_templates.py| 6 --
 tests/end2end/test_hello_world.py  | 2 +-
 tests/end2end/test_nodecellar.py   | 2 +-
 5 files changed, 9 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5760b4e3/aria/cli/commands/service_templates.py
--
diff --git a/aria/cli/commands/service_templates.py 
b/aria/cli/commands/service_templates.py
index 0a24907..d139195 100644
--- a/aria/cli/commands/service_templates.py
+++ b/aria/cli/commands/service_templates.py
@@ -89,8 +89,8 @@ def show(service_template_name, model_storage, mode_full, 
mode_types, format_jso
 
 if service_template.services:
 logger.info('Existing services:')
-for service in service_template.services:
-logger.info('\t{0}'.format(service.name))
+for service_name in service_template.services:
+logger.info('\t{0}'.format(service_name))
 
 
 @service_templates.command(name='list',

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5760b4e3/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7eb35bd..1eb95a3 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -208,7 +208,7 @@ class ServiceTemplateBase(TemplateModelMixin):
 
 @declared_attr
 def services(cls):
-return relationship.one_to_many(cls, 'service')
+return relationship.one_to_many(cls, 'service', dict_key='name')
 
 @declared_attr
 def operation_templates(cls):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5760b4e3/tests/cli/test_service_templates.py
--
diff --git a/tests/cli/test_service_templates.py 
b/tests/cli/test_service_templates.py
index bc3c751..7e86896 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -65,7 +65,8 @@ class TestServiceTemplatesShow(TestCliBase):
 
 monkeypatch.setattr(_Environment, 'model_storage', mock_storage)
 st = mock_models.create_service_template()
-st.services = [mock_models.create_service(st)]
+s = mock_models.create_service(st)
+st.services = {s.name: s}
 monkeypatch.setattr(mock_storage.service_template, 'get_by_name',
 mock.MagicMock(return_value=st))
 
@@ -79,7 +80,8 @@ class TestServiceTemplatesShow(TestCliBase):
 
 monkeypatch.setattr(_Environment, 'model_storage', mock_storage)
 st = 
mock_models.create_service_template(description='test_description')
-st.services = [mock_models.create_service(st)]
+s = mock_models.create_service(st)
+st.services = {s.name: s}
 monkeypatch.setattr(mock_storage.service_template, 'get_by_name',
 mock.MagicMock(return_value=st))
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/5760b4e3/tests/end2end/test_hello_world.py
--
diff --git a/tests/end2end/test_hello_world.py 
b/tests/end2end/test_hello_world.py
index fc5f631..71792dd 100644
--- a/tests/end2end/test_hello_world.py
+++ b/tests/end2end/test_hello_world.py
@@ -52,7 +52,7 @@ def _verify_deployed_service_in_storage(service_name, 
model_storage):
 service_templates = model_storage.service_template.list()
 assert len(service_templates) == 1
 assert 

[jira] [Assigned] (ARIA-180) Convert many-to-many for parameter models to one-to-many

2017-05-15 Thread Avia Efrat (JIRA)

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

Avia Efrat reassigned ARIA-180:
---

Assignee: Avia Efrat

> Convert many-to-many for parameter models to one-to-many
> 
>
> Key: ARIA-180
> URL: https://issues.apache.org/jira/browse/ARIA-180
> Project: AriaTosca
>  Issue Type: Task
>Reporter: Tal Liron
>Assignee: Avia Efrat
>Priority: Minor
>
> We must first discuss this as a team to see if we agree that this is the best 
> solution. (There was an early discussion between Tal and Maxim.)
> First let's point out that one-to-many is a special case of many-to-many, so 
> that everything works fine now and continue to work fine.
> However, logically our code right now treats them as one-to-many: there is no 
> case in which a {{Parameter}} model belongs to more than one model. 
> Parameters are always copied to the new model, for example during 
> instantiation, or during task creation.
> There are cons to using many-to-many in our case:
> * We generate lots of extra secondary tables, one for each potential 
> relationship
> * Crawling back from a {{Parameter}} to its containing model is quite costly, 
> as it involves a new SQL query to check for each possible relationship
> * Logical confusion: if we do not write our code to support one parameter 
> belonging to one model, and yet a user can create such a relationship, what 
> would happen?
> * Slower
> The one advantage of many-to-many is that we *could* potentially optimize in 
> some cases where the parameter has an identical value and we know would never 
> change, and thus could safely link it multiple times instead of copying it. 
> This optimization, however, requires us to be 100% sure that the parameter is 
> immutable: otherwise, if a user changes it (for example in a task) it would 
> change for all other containers. The questions are: 1) are we ever sure of 
> immutability? and 2) is this optimization worth the effort of implementing 
> it? The optimization would only seem to save some disk space.
> Another advantage is that it's much easier to add new models that use 
> {{Parameter}} by adding an extra table (many-to-many) rather than adding fk 
> columns to an existing table. To that there is a simple answer: new models 
> can definitely create many-to-many relationships to anything else. Using 
> one-to-many for our own models doesn't preclude that. (And we can even add 
> code that automatically tries to look through such many-to-many relationships 
> in order to find a container.)
> If we decide to switch to one-to-many, we have two approached:
> * Straightforward: one foreign key in {{Parameter}} per each possible 
> containing relationship. Pros: naturally supported in SQL, cons: we will have 
> lots of fk columns per row in the {{Parameter}} table, whereby only one will 
> be non-null.
> * Polymorphic one-to-many (type-and-id joins): {{Parameter}} only has a 
> single general-purpose fk column and another column specifying the type of 
> the fk (node, interface, task, etc.). Cons: we would need to investigate how 
> to accomplish this in SQLAlchemy.



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


[jira] [Commented] (ARIA-171) Service_template.services type inconsistency

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

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

ASF GitHub Bot commented on ARIA-171:
-

GitHub user AviaE opened a pull request:

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

ARIA-171 service_template.services type inconsistency

As opposed to service_template.node_templates and service.nodes
which have a dict interface, service_template.services
had a list interface. That seemed as inconsistent, so the former
interface was changed to a dict interface as well.

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

$ git pull https://github.com/apache/incubator-ariatosca 
ARIA-171-service-template-services-type-inconsistency

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

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


commit 4425c10306517cffce930b3f81623f350a116fae
Author: Avia Efrat 
Date:   2017-05-15T11:26:34Z

ARIA-171 service_template.services type inconsistency

As opposed to service_template.node_templates and service.nodes
which have a dict interface, service_template.services
had a list interface. That seemed as inconsistent, so the former
interface was changed to a dict interface as well.




> Service_template.services type inconsistency
> 
>
> Key: ARIA-171
> URL: https://issues.apache.org/jira/browse/ARIA-171
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Avia Efrat
>
> {{service_template.services}} is an object of type {{InstrumentedList}}, 
> which is inconsistent with similar forms of model access (e.g. 
> {{service.nodes}}).
> The object's type should instead be a {{MappedCollection}} from the service 
> name to the service model object.



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


[GitHub] incubator-ariatosca pull request #132: ARIA-171 service_template.services ty...

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

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

ARIA-171 service_template.services type inconsistency

As opposed to service_template.node_templates and service.nodes
which have a dict interface, service_template.services
had a list interface. That seemed as inconsistent, so the former
interface was changed to a dict interface as well.

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

$ git pull https://github.com/apache/incubator-ariatosca 
ARIA-171-service-template-services-type-inconsistency

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

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


commit 4425c10306517cffce930b3f81623f350a116fae
Author: Avia Efrat 
Date:   2017-05-15T11:26:34Z

ARIA-171 service_template.services type inconsistency

As opposed to service_template.node_templates and service.nodes
which have a dict interface, service_template.services
had a list interface. That seemed as inconsistent, so the former
interface was changed to a dict interface as well.




---
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-171 service_template.services type inconsistency

2017-05-15 Thread avia
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-171-service-template-services-type-inconsistency [created] 
4425c1030


ARIA-171 service_template.services type inconsistency

As opposed to service_template.node_templates and service.nodes
which have a dict interface, service_template.services
had a list interface. That seemed as inconsistent, so the former
interface was changed to a dict interface as well.


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

Branch: refs/heads/ARIA-171-service-template-services-type-inconsistency
Commit: 4425c10306517cffce930b3f81623f350a116fae
Parents: fdd57c4
Author: Avia Efrat 
Authored: Mon May 15 14:26:34 2017 +0300
Committer: Avia Efrat 
Committed: Mon May 15 14:26:34 2017 +0300

--
 aria/cli/commands/service_templates.py | 4 ++--
 aria/modeling/service_template.py  | 2 +-
 tests/cli/test_service_templates.py| 6 --
 3 files changed, 7 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4425c103/aria/cli/commands/service_templates.py
--
diff --git a/aria/cli/commands/service_templates.py 
b/aria/cli/commands/service_templates.py
index 0a24907..d139195 100644
--- a/aria/cli/commands/service_templates.py
+++ b/aria/cli/commands/service_templates.py
@@ -89,8 +89,8 @@ def show(service_template_name, model_storage, mode_full, 
mode_types, format_jso
 
 if service_template.services:
 logger.info('Existing services:')
-for service in service_template.services:
-logger.info('\t{0}'.format(service.name))
+for service_name in service_template.services:
+logger.info('\t{0}'.format(service_name))
 
 
 @service_templates.command(name='list',

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4425c103/aria/modeling/service_template.py
--
diff --git a/aria/modeling/service_template.py 
b/aria/modeling/service_template.py
index 7eb35bd..1eb95a3 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -208,7 +208,7 @@ class ServiceTemplateBase(TemplateModelMixin):
 
 @declared_attr
 def services(cls):
-return relationship.one_to_many(cls, 'service')
+return relationship.one_to_many(cls, 'service', dict_key='name')
 
 @declared_attr
 def operation_templates(cls):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/4425c103/tests/cli/test_service_templates.py
--
diff --git a/tests/cli/test_service_templates.py 
b/tests/cli/test_service_templates.py
index bc3c751..7e86896 100644
--- a/tests/cli/test_service_templates.py
+++ b/tests/cli/test_service_templates.py
@@ -65,7 +65,8 @@ class TestServiceTemplatesShow(TestCliBase):
 
 monkeypatch.setattr(_Environment, 'model_storage', mock_storage)
 st = mock_models.create_service_template()
-st.services = [mock_models.create_service(st)]
+s = mock_models.create_service(st)
+st.services = {s.name: s}
 monkeypatch.setattr(mock_storage.service_template, 'get_by_name',
 mock.MagicMock(return_value=st))
 
@@ -79,7 +80,8 @@ class TestServiceTemplatesShow(TestCliBase):
 
 monkeypatch.setattr(_Environment, 'model_storage', mock_storage)
 st = 
mock_models.create_service_template(description='test_description')
-st.services = [mock_models.create_service(st)]
+s = mock_models.create_service(st)
+st.services = {s.name: s}
 monkeypatch.setattr(mock_storage.service_template, 'get_by_name',
 mock.MagicMock(return_value=st))
 



[jira] [Commented] (ARIA-171) Service_template.services type inconsistency

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

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

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

Commit 4425c10306517cffce930b3f81623f350a116fae in incubator-ariatosca's branch 
refs/heads/ARIA-171-service-template-services-type-inconsistency from [~avia]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=4425c10 ]

ARIA-171 service_template.services type inconsistency

As opposed to service_template.node_templates and service.nodes
which have a dict interface, service_template.services
had a list interface. That seemed as inconsistent, so the former
interface was changed to a dict interface as well.


> Service_template.services type inconsistency
> 
>
> Key: ARIA-171
> URL: https://issues.apache.org/jira/browse/ARIA-171
> Project: AriaTosca
>  Issue Type: Bug
>Reporter: Ran Ziv
>Assignee: Avia Efrat
>
> {{service_template.services}} is an object of type {{InstrumentedList}}, 
> which is inconsistent with similar forms of model access (e.g. 
> {{service.nodes}}).
> The object's type should instead be a {{MappedCollection}} from the service 
> name to the service model object.



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


incubator-ariatosca git commit: fixed some tests [Forced Update!]

2017-05-15 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/runtime_props_to_attr de86fb8c6 -> 1c7347e6d (forced update)


fixed some tests


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

Branch: refs/heads/runtime_props_to_attr
Commit: 1c7347e6d6a6d752faf896743f2375276759f338
Parents: 87dad55
Author: max-orlov 
Authored: Mon May 15 12:26:35 2017 +0300
Committer: max-orlov 
Committed: Mon May 15 13:10:37 2017 +0300

--
 aria/orchestrator/context/operation.py   |  6 +++---
 aria/storage/instrumentation.py  | 25 ---
 tests/orchestrator/context/test_operation.py | 14 +++--
 3 files changed, 24 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1c7347e6/aria/orchestrator/context/operation.py
--
diff --git a/aria/orchestrator/context/operation.py 
b/aria/orchestrator/context/operation.py
index 2c3f173..2182db5 100644
--- a/aria/orchestrator/context/operation.py
+++ b/aria/orchestrator/context/operation.py
@@ -80,9 +80,9 @@ class _DecorateAttributes(object):
 
 def __call__(self, *args, **kwargs):
 func_self = args[0]
-actor = self._func(*args, **kwargs)
-model = func_self.model
-self.attributes = self._Attributes(model, actor)
+self._actor = self._func(*args, **kwargs)
+self._model = func_self.model
+self.attributes = self._Attributes(self._model, self._actor)
 return self
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1c7347e6/aria/storage/instrumentation.py
--
diff --git a/aria/storage/instrumentation.py b/aria/storage/instrumentation.py
index 701c058..a11bb28 100644
--- a/aria/storage/instrumentation.py
+++ b/aria/storage/instrumentation.py
@@ -148,12 +148,12 @@ class _Instrumentation(object):
 def listener(target, value, initiator):
 tracked_instances = 
self.tracked_changes.setdefault(target.__modelname__, {})
 tracked_attributes = tracked_instances.setdefault(target.id, {})
-collection = tracked_attributes.setdefault(initiator.key, [])
+collection_attr = tracked_attributes.setdefault(initiator.key, [])
 instance_as_dict = value.to_dict()
 instance_as_dict.update((k, getattr(value, k))
 for k in getattr(value, 
'__private_fields__', []))
 instance_as_dict['_MODEL_CLS'] = value.__modelname__
-collection.append(instance_as_dict)
+collection_attr.append(instance_as_dict)
 
 listener_args = (collection_attr, 'append', listener)
 sqlalchemy.event.listen(*listener_args)
@@ -254,21 +254,22 @@ def apply_tracked_changes(tracked_changes, new_instances, 
model):
 """
 successfully_updated_changes = dict()
 try:
+
+# Handle new instances
+for mapi_name, new_instance in new_instances.items():
+successfully_updated_changes[mapi_name] = dict()
+mapi = getattr(model, mapi_name)
+for tmp_id, new_instance_kwargs in new_instance.items():
+instance = mapi.model_cls(**new_instance_kwargs)
+mapi.put(instance)
+successfully_updated_changes[mapi_name][instance.id] = 
new_instance_kwargs
+new_instance[tmp_id] = instance
+
 # handle instance updates
 for mapi_name, tracked_instances in tracked_changes.items():
 successfully_updated_changes[mapi_name] = dict()
 mapi = getattr(model, mapi_name)
 
-# Handle new instances
-for mapi_name, new_instance in new_instances.items():
-successfully_updated_changes[mapi_name] = dict()
-mapi = getattr(model, mapi_name)
-for tmp_id, new_instance_kwargs in new_instance.items():
-instance = mapi.model_cls(**new_instance_kwargs)
-mapi.put(instance)
-successfully_updated_changes[mapi_name][instance.id] = 
new_instance_kwargs
-new_instance[tmp_id] = instance
-
 for instance_id, tracked_attributes in tracked_instances.items():
 successfully_updated_changes[mapi_name][instance_id] = dict()
 instance = None

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1c7347e6/tests/orchestrator/context/test_operation.py

incubator-ariatosca git commit: fixed some tests

2017-05-15 Thread mxmrlv
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/runtime_props_to_attr 87dad5511 -> de86fb8c6


fixed some tests


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

Branch: refs/heads/runtime_props_to_attr
Commit: de86fb8c6bf8f959dc01e4859360663c88d0ff86
Parents: 87dad55
Author: max-orlov 
Authored: Mon May 15 12:26:35 2017 +0300
Committer: max-orlov 
Committed: Mon May 15 12:26:35 2017 +0300

--
 aria/orchestrator/context/operation.py  |  6 ++---
 aria/orchestrator/workflows/executor/process.py |  1 +
 aria/storage/instrumentation.py | 25 ++--
 tests/orchestrator/context/test_operation.py| 15 +++-
 4 files changed, 26 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/de86fb8c/aria/orchestrator/context/operation.py
--
diff --git a/aria/orchestrator/context/operation.py 
b/aria/orchestrator/context/operation.py
index 2c3f173..2182db5 100644
--- a/aria/orchestrator/context/operation.py
+++ b/aria/orchestrator/context/operation.py
@@ -80,9 +80,9 @@ class _DecorateAttributes(object):
 
 def __call__(self, *args, **kwargs):
 func_self = args[0]
-actor = self._func(*args, **kwargs)
-model = func_self.model
-self.attributes = self._Attributes(model, actor)
+self._actor = self._func(*args, **kwargs)
+self._model = func_self.model
+self.attributes = self._Attributes(self._model, self._actor)
 return self
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/de86fb8c/aria/orchestrator/workflows/executor/process.py
--
diff --git a/aria/orchestrator/workflows/executor/process.py 
b/aria/orchestrator/workflows/executor/process.py
index c3962ed..3d9b701 100644
--- a/aria/orchestrator/workflows/executor/process.py
+++ b/aria/orchestrator/workflows/executor/process.py
@@ -354,6 +354,7 @@ def _patch_ctx(ctx, messenger, instrument):
 
 
 def _main():
+import pydevd; pydevd.settrace('localhost', suspend=False)
 arguments_json_path = sys.argv[1]
 with open(arguments_json_path) as f:
 arguments = pickle.loads(f.read())

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/de86fb8c/aria/storage/instrumentation.py
--
diff --git a/aria/storage/instrumentation.py b/aria/storage/instrumentation.py
index 701c058..a11bb28 100644
--- a/aria/storage/instrumentation.py
+++ b/aria/storage/instrumentation.py
@@ -148,12 +148,12 @@ class _Instrumentation(object):
 def listener(target, value, initiator):
 tracked_instances = 
self.tracked_changes.setdefault(target.__modelname__, {})
 tracked_attributes = tracked_instances.setdefault(target.id, {})
-collection = tracked_attributes.setdefault(initiator.key, [])
+collection_attr = tracked_attributes.setdefault(initiator.key, [])
 instance_as_dict = value.to_dict()
 instance_as_dict.update((k, getattr(value, k))
 for k in getattr(value, 
'__private_fields__', []))
 instance_as_dict['_MODEL_CLS'] = value.__modelname__
-collection.append(instance_as_dict)
+collection_attr.append(instance_as_dict)
 
 listener_args = (collection_attr, 'append', listener)
 sqlalchemy.event.listen(*listener_args)
@@ -254,21 +254,22 @@ def apply_tracked_changes(tracked_changes, new_instances, 
model):
 """
 successfully_updated_changes = dict()
 try:
+
+# Handle new instances
+for mapi_name, new_instance in new_instances.items():
+successfully_updated_changes[mapi_name] = dict()
+mapi = getattr(model, mapi_name)
+for tmp_id, new_instance_kwargs in new_instance.items():
+instance = mapi.model_cls(**new_instance_kwargs)
+mapi.put(instance)
+successfully_updated_changes[mapi_name][instance.id] = 
new_instance_kwargs
+new_instance[tmp_id] = instance
+
 # handle instance updates
 for mapi_name, tracked_instances in tracked_changes.items():
 successfully_updated_changes[mapi_name] = dict()
 mapi = getattr(model, mapi_name)
 
-# Handle new instances
-for mapi_name, new_instance in new_instances.items():
-