Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-48-aria-cli a39e7d134 -> 82591f06c
final review fixes Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/82591f06 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/82591f06 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/82591f06 Branch: refs/heads/ARIA-48-aria-cli Commit: 82591f06c023d93755c7cb123b1b49f5c51f5bec Parents: a39e7d1 Author: Ran Ziv <[email protected]> Authored: Wed Apr 19 15:18:08 2017 +0300 Committer: Ran Ziv <[email protected]> Committed: Wed Apr 19 15:18:08 2017 +0300 ---------------------------------------------------------------------- aria/cli/commands/executions.py | 6 +++--- aria/cli/commands/node_templates.py | 6 +++--- aria/cli/commands/nodes.py | 6 +++--- aria/cli/commands/plugins.py | 6 +++--- aria/cli/commands/services.py | 4 ++-- aria/cli/commands/workflows.py | 6 +++--- aria/cli/core/aria.py | 10 +++++----- aria/cli/defaults.py | 8 ++++---- aria/orchestrator/plugin.py | 1 + 9 files changed, 27 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/82591f06/aria/cli/commands/executions.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/executions.py b/aria/cli/commands/executions.py index adec56b..e100f0d 100644 --- a/aria/cli/commands/executions.py +++ b/aria/cli/commands/executions.py @@ -16,9 +16,9 @@ import os from .. import helptexts +from .. import table from .. import utils from ..core import aria -from ..table import print_data from ...modeling.models import Execution from ...orchestrator.workflow_runner import WorkflowRunner from ...orchestrator.workflows.executor.dry import DryExecutor @@ -51,7 +51,7 @@ def show(execution_id, model_storage, logger): logger.info('Showing execution {0}'.format(execution_id)) execution = model_storage.execution.get(execution_id) - print_data(EXECUTION_COLUMNS, execution, 'Execution:', col_max_width=50) + table.print_data(EXECUTION_COLUMNS, execution, 'Execution:', col_max_width=50) # print execution parameters logger.info('Execution Inputs:') @@ -96,7 +96,7 @@ def list(service_name, filters=filters, sort=utils.storage_sort_param(sort_by, descending)).items - print_data(EXECUTION_COLUMNS, executions_list, 'Executions:') + table.print_data(EXECUTION_COLUMNS, executions_list, 'Executions:') @executions.command(name='start', http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/82591f06/aria/cli/commands/node_templates.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/node_templates.py b/aria/cli/commands/node_templates.py index f0ca2c1..4d53f54 100644 --- a/aria/cli/commands/node_templates.py +++ b/aria/cli/commands/node_templates.py @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from .. import table from .. import utils from ..core import aria -from ..table import print_data NODE_TEMPLATE_COLUMNS = ['id', 'name', 'description', 'service_template_name', 'type_name'] @@ -44,7 +44,7 @@ def show(node_template_id, model_storage, logger): logger.info('Showing node template {0}'.format(node_template_id)) node_template = model_storage.node_template.get(node_template_id) - print_data(NODE_TEMPLATE_COLUMNS, node_template, 'Node template:', col_max_width=50) + table.print_data(NODE_TEMPLATE_COLUMNS, node_template, 'Node template:', col_max_width=50) # print node template properties logger.info('Node template properties:') @@ -90,4 +90,4 @@ def list(service_template_name, sort_by, descending, model_storage, logger): filters=filters, sort=utils.storage_sort_param(sort_by, descending)).items - print_data(NODE_TEMPLATE_COLUMNS, node_templates_list, 'Node templates:') + table.print_data(NODE_TEMPLATE_COLUMNS, node_templates_list, 'Node templates:') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/82591f06/aria/cli/commands/nodes.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/nodes.py b/aria/cli/commands/nodes.py index 0a00478..eeab338 100644 --- a/aria/cli/commands/nodes.py +++ b/aria/cli/commands/nodes.py @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from .. import table from .. import utils from ..core import aria -from ..table import print_data NODE_COLUMNS = ['id', 'name', 'service_name', 'node_template_name', 'state'] @@ -43,7 +43,7 @@ def show(node_id, model_storage, logger): logger.info('Showing node {0}'.format(node_id)) node = model_storage.node.get(node_id) - print_data(NODE_COLUMNS, node, 'Node:', 50) + table.print_data(NODE_COLUMNS, node, 'Node:', 50) # print node attributes logger.info('Node attributes:') @@ -84,4 +84,4 @@ def list(service_name, filters=filters, sort=utils.storage_sort_param(sort_by, descending)).items - print_data(NODE_COLUMNS, nodes_list, 'Nodes:') + table.print_data(NODE_COLUMNS, nodes_list, 'Nodes:') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/82591f06/aria/cli/commands/plugins.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/plugins.py b/aria/cli/commands/plugins.py index 22552d6..670288e 100644 --- a/aria/cli/commands/plugins.py +++ b/aria/cli/commands/plugins.py @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from .. import table from .. import utils from ..core import aria -from ..table import print_data PLUGIN_COLUMNS = ['id', 'package_name', 'package_version', 'supported_platform', @@ -80,7 +80,7 @@ def show(plugin_id, model_storage, logger): """ logger.info('Showing plugin {0}...'.format(plugin_id)) plugin = model_storage.plugin.get(plugin_id) - print_data(PLUGIN_COLUMNS, plugin, 'Plugin:') + table.print_data(PLUGIN_COLUMNS, plugin, 'Plugin:') @plugins.command(name='list', @@ -96,4 +96,4 @@ def list(sort_by, descending, model_storage, logger): logger.info('Listing all plugins...') plugins_list = model_storage.plugin.list( sort=utils.storage_sort_param(sort_by, descending)).items - print_data(PLUGIN_COLUMNS, plugins_list, 'Plugins:') + table.print_data(PLUGIN_COLUMNS, plugins_list, 'Plugins:') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/82591f06/aria/cli/commands/services.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/services.py b/aria/cli/commands/services.py index e1569a6..1aa99f3 100644 --- a/aria/cli/commands/services.py +++ b/aria/cli/commands/services.py @@ -19,9 +19,9 @@ from StringIO import StringIO from . import service_templates from .. import helptexts +from .. import table from .. import utils from ..core import aria -from ..table import print_data from ...core import Core from ...modeling import exceptions as modeling_exceptions from ...storage import exceptions as storage_exceptions @@ -67,7 +67,7 @@ def list(service_template_name, services_list = model_storage.service.list( sort=utils.storage_sort_param(sort_by=sort_by, descending=descending), filters=filters).items - print_data(SERVICE_COLUMNS, services_list, 'Services:') + table.print_data(SERVICE_COLUMNS, services_list, 'Services:') @services.command(name='create', http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/82591f06/aria/cli/commands/workflows.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/workflows.py b/aria/cli/commands/workflows.py index 5bd23b7..221dbc4 100644 --- a/aria/cli/commands/workflows.py +++ b/aria/cli/commands/workflows.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +from .. import table from ..core import aria -from ..table import print_data from ..exceptions import AriaCliError WORKFLOW_COLUMNS = ['name', 'service_template_name', 'service_name'] @@ -52,7 +52,7 @@ def show(workflow_name, service_name, model_storage, logger): 'service_template_name': service.service_template_name, 'service_name': service.name } - print_data(WORKFLOW_COLUMNS, workflow, 'Workflows:', defaults=defaults) + table.print_data(WORKFLOW_COLUMNS, workflow, 'Workflows:', defaults=defaults) # print workflow inputs required_inputs = dict() @@ -97,4 +97,4 @@ def list(service_name, model_storage, logger): 'service_template_name': service.service_template_name, 'service_name': service.name } - print_data(WORKFLOW_COLUMNS, workflows_list, 'Workflows:', defaults=defaults) + table.print_data(WORKFLOW_COLUMNS, workflows_list, 'Workflows:', defaults=defaults) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/82591f06/aria/cli/core/aria.py ---------------------------------------------------------------------- diff --git a/aria/cli/core/aria.py b/aria/cli/core/aria.py index fe6dc4b..ed7c490 100644 --- a/aria/cli/core/aria.py +++ b/aria/cli/core/aria.py @@ -30,8 +30,8 @@ from ..env import ( from .. import defaults from .. import helptexts from ..inputs import inputs_to_dict -from ...utils.exceptions import get_exception_as_string from ... import __version__ +from ...utils.exceptions import get_exception_as_string CLICK_CONTEXT_SETTINGS = dict( @@ -316,13 +316,13 @@ class Options(object): '--descending', required=False, is_flag=True, - default=defaults.SORT_DESCENDING_DEFAULT, + default=defaults.SORT_DESCENDING, help=helptexts.DESCENDING) self.service_template_filename = click.option( '-n', '--service-template-filename', - default=defaults.SERVICE_TEMPLATE_FILENAME_DEFAULT, + default=defaults.SERVICE_TEMPLATE_FILENAME, help=helptexts.SERVICE_TEMPLATE_FILENAME) @staticmethod @@ -354,7 +354,7 @@ class Options(object): help=help) @staticmethod - def task_max_attempts(default=defaults.TASK_MAX_ATTEMPTS_DEFAULT): + def task_max_attempts(default=defaults.TASK_MAX_ATTEMPTS): return click.option( '--task-max-attempts', type=int, @@ -370,7 +370,7 @@ class Options(object): help=helptexts.SORT_BY) @staticmethod - def task_retry_interval(default=defaults.TASK_RETRY_INTERVAL_DEFAULT): + def task_retry_interval(default=defaults.TASK_RETRY_INTERVAL): return click.option( '--task-retry-interval', type=int, http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/82591f06/aria/cli/defaults.py ---------------------------------------------------------------------- diff --git a/aria/cli/defaults.py b/aria/cli/defaults.py index 6befd25..5c16938 100644 --- a/aria/cli/defaults.py +++ b/aria/cli/defaults.py @@ -14,7 +14,7 @@ # limitations under the License. -SERVICE_TEMPLATE_FILENAME_DEFAULT = 'service_template.yaml' -TASK_MAX_ATTEMPTS_DEFAULT = 30 -TASK_RETRY_INTERVAL_DEFAULT = 30 -SORT_DESCENDING_DEFAULT = False +SERVICE_TEMPLATE_FILENAME = 'service_template.yaml' +TASK_MAX_ATTEMPTS = 30 +TASK_RETRY_INTERVAL = 30 +SORT_DESCENDING = False http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/82591f06/aria/orchestrator/plugin.py ---------------------------------------------------------------------- diff --git a/aria/orchestrator/plugin.py b/aria/orchestrator/plugin.py index b79d7fc..f99666c 100644 --- a/aria/orchestrator/plugin.py +++ b/aria/orchestrator/plugin.py @@ -44,6 +44,7 @@ class PluginManager(object): os_props = metadata['build_server_os_properties'] plugin = cls( + name=metadata['package_name'], archive_name=metadata['archive_name'], supported_platform=metadata['supported_platform'], supported_py_versions=metadata['supported_python_versions'],
