[GitHub] incubator-ariatosca pull request #146: ARIA-199 Add "services outputs" CLI c...

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

https://github.com/apache/incubator-ariatosca/pull/146#discussion_r120391233
  
--- Diff: 
tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml 
---
@@ -302,6 +306,14 @@ topology_template:
 capabilities:
   app_endpoint: [ loadbalancer, client ]
 
+  outputs:
--- End diff --

Done.


---
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 #146: ARIA-199 Add "services outputs" CLI c...

2017-06-04 Thread AviaE
Github user AviaE commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/146#discussion_r120009954
  
--- Diff: aria/cli/commands/services.py ---
@@ -192,17 +192,17 @@ def outputs(service_name, model_storage, logger):
 """
 logger.info('Showing outputs for service {0}...'.format(service_name))
 service = model_storage.service.get_by_name(service_name)
-#TODO fix this section..
-outputs_def = service.outputs
-response = model_storage.service.outputs.get(service_name)
-outputs_ = StringIO()
-for output_name, output in response.outputs.iteritems():
-outputs_.write(' - "{0}":{1}'.format(output_name, os.linesep))
-description = outputs_def[output_name].get('description', '')
-outputs_.write(' Description: {0}{1}'.format(description,
- os.linesep))
-outputs_.write(' Value: {0}{1}'.format(output, os.linesep))
-logger.info(outputs_.getvalue())
+
+if service.outputs:
+outputs_ = StringIO()
+for output_name, output in service.outputs.iteritems():
+outputs_.write(' - "{0}":{1}'.format(output_name, os.linesep))
+outputs_.write(' Description: 
{0}{1}'.format(output.description,
--- End diff --

You can put `os.linesep` in the same line as `Description`, it is short 
enough, and consistent with the other lines.


---
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 #146: ARIA-199 Add "services outputs" CLI c...

2017-06-04 Thread AviaE
Github user AviaE commented on a diff in the pull request:

https://github.com/apache/incubator-ariatosca/pull/146#discussion_r120009903
  
--- Diff: tests/mock/models.py ---
@@ -96,6 +97,9 @@ def 
create_service_with_dependencies(include_execution=False,
 if include_input:
 input = create_parameter(name='input1', value='value1')
 service.inputs = {'input1': input}
+if include_output:
--- End diff --

Now, that ARIA-180 was merged, we have a dedicated `create_input` function.
Similarly, please add a `create_output` function =)
In addition, as in `services outputs` we also print the description of the 
output, so it would be nice to add the description as a parameter to the 
`create_output` function, and to check for the existence of that printed 
description in the console output (`logger output string`).

On another note, According to the TOSCA spec, inputs also have a 
description, and the is not addressed in the current `create_input` and tests 
for `services outputs`. You have me permission [:)] to fix it in the context of 
this commit, as it is very closely related to it. If you prefer not to, it will 
be addressed in this JIRA: https://issues.apache.org/jira/browse/ARIA-192 ("Fix 
output inconsistencies in CLI").


---
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 #146: ARIA-199 Add "services outputs" CLI c...

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

https://github.com/apache/incubator-ariatosca/pull/146#discussion_r120004762
  
--- Diff: 
tests/resources/service-templates/tosca-simple-1.0/node-cellar/node-cellar.yaml 
---
@@ -302,6 +306,14 @@ topology_template:
 capabilities:
   app_endpoint: [ loadbalancer, client ]
 
+  outputs:
--- End diff --

It'd be better (or rather, also good) to have an `outputs` section appended 
to the `hello-world` example, and then use it in the end2end test to grab the 
URL of the web server.


---
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 #146: ARIA-199 Add "services outputs" CLI c...

2017-06-02 Thread tliron
GitHub user tliron opened a pull request:

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

ARIA-199 Add "services outputs" CLI command



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

$ git pull https://github.com/apache/incubator-ariatosca 
ARIA-199-cli-service-output

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

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


commit 79b94e1f9aed3be3176b96870f7ea472146032c3
Author: Tal Liron 
Date:   2017-06-02T19:20:28Z

ARIA-199 Add "services outputs" CLI command




---
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.
---