ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm...@apache.org
Subject [01/18] incubator-ariatosca git commit: fixed pylint issues [Forced Update!]
Date Mon, 10 Apr 2017 09:51:10 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/logger_task 93444421b -> 14219f96b (forced update)


fixed pylint issues


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

Branch: refs/heads/logger_task
Commit: 45f61a0f4da4e6d6b069ee1f2067ffdf76917b6c
Parents: 7c567b0
Author: Ran Ziv <ran@gigaspaces.com>
Authored: Thu Apr 6 12:55:26 2017 +0300
Committer: Ran Ziv <ran@gigaspaces.com>
Committed: Thu Apr 6 12:55:26 2017 +0300

----------------------------------------------------------------------
 aria/cli/cli/aria.py                            | 12 ++++-----
 aria/cli/commands/executions.py                 |  4 +--
 aria/cli/commands/logs.py                       | 15 +++++------
 aria/cli/commands/node_templates.py             |  4 +--
 aria/cli/commands/nodes.py                      |  4 +--
 aria/cli/commands/plugins.py                    |  6 ++---
 aria/cli/commands/service_templates.py          | 10 ++++----
 aria/cli/commands/services.py                   |  9 ++++---
 aria/cli/commands/workflows.py                  |  5 ++--
 aria/cli/main.py                                |  3 +--
 aria/cli/service_template_utils.py              |  2 +-
 aria/cli/table.py                               | 26 ++++++++++----------
 aria/cli/utils.py                               | 10 ++++----
 aria/modeling/models.py                         |  9 +++----
 aria/modeling/orchestration.py                  |  1 -
 aria/modeling/service_template.py               |  2 +-
 aria/orchestrator/context/common.py             |  3 ++-
 aria/orchestrator/workflows/api/task.py         |  1 -
 .../workflows/builtin/execute_operation.py      |  1 -
 aria/orchestrator/workflows/builtin/utils.py    |  2 +-
 aria/utils/archive.py                           |  8 +++---
 aria/utils/formatting.py                        | 12 ++++-----
 aria/utils/threading.py                         |  4 +--
 aria/utils/type.py                              |  2 +-
 24 files changed, 75 insertions(+), 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/cli/aria.py
----------------------------------------------------------------------
diff --git a/aria/cli/cli/aria.py b/aria/cli/cli/aria.py
index 1664ce5..0177134 100644
--- a/aria/cli/cli/aria.py
+++ b/aria/cli/cli/aria.py
@@ -129,17 +129,17 @@ def set_cli_except_hook():
         for solution in possible_solutions:
             logger.info('  - {0}'.format(solution))
 
-    def new_excepthook(tpe, value, tb):
+    def new_excepthook(tpe, value, trace):
         if env.logging.is_high_verbose_level():
             # log error including traceback
-            logger.error(get_exception_as_string(tpe, value, tb))
+            logger.error(get_exception_as_string(tpe, value, trace))
         else:
             # write the full error to the log file
             with open(env.logging.log_file, 'a') as log_file:
                 traceback.print_exception(
                     etype=tpe,
                     value=value,
-                    tb=tb,
+                    tb=trace,
                     file=log_file)
             # print only the error message
             print value
@@ -211,9 +211,9 @@ class AliasedGroup(click.Group):
         super(AliasedGroup, self).__init__(*args, **kwargs)
 
     def get_command(self, ctx, cmd_name):
-        rv = click.Group.get_command(self, ctx, cmd_name)
-        if rv is not None:
-            return rv
+        cmd = click.Group.get_command(self, ctx, cmd_name)
+        if cmd is not None:
+            return cmd
         matches = \
             [x for x in self.list_commands(ctx) if x.startswith(cmd_name)]
         if not matches:

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/commands/executions.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/executions.py b/aria/cli/commands/executions.py
index cc8bf6c..396985a 100644
--- a/aria/cli/commands/executions.py
+++ b/aria/cli/commands/executions.py
@@ -90,11 +90,11 @@ def list(service_name,
         logger.info('Listing all executions...')
         filters = {}
 
-    executions = [e.to_dict() for e in model_storage.execution.list(
+    executions_list = [e.to_dict() for e in model_storage.execution.list(
         filters=filters,
         sort=utils.storage_sort_param(sort_by, descending))]
 
-    print_data(EXECUTION_COLUMNS, executions, 'Executions:')
+    print_data(EXECUTION_COLUMNS, executions_list, 'Executions:')
 
 
 @executions.command(name='start',

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/commands/logs.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/logs.py b/aria/cli/commands/logs.py
index 3662063..f8873cd 100644
--- a/aria/cli/commands/logs.py
+++ b/aria/cli/commands/logs.py
@@ -28,23 +28,20 @@ def logs():
 @logs.command(name='list',
               short_help='List execution logs')
 @aria.argument('execution-id')
-@aria.options.json_output
 @aria.options.verbose()
 @aria.pass_model_storage
 @aria.pass_logger
 def list(execution_id,
-         json_output,
          model_storage,
          logger):
     """Display logs for an execution
     """
     logger.info('Listing logs for execution id {0}'.format(execution_id))
-    # events_logger = get_events_logger(json_output)
-    logs = model_storage.log.list(filters=dict(execution_fk=execution_id),
-                                  sort=utils.storage_sort_param('created_at', False))
+    logs_list = model_storage.log.list(filters=dict(execution_fk=execution_id),
+                                       sort=utils.storage_sort_param('created_at', False))
     # TODO: print logs nicely
-    if logs:
-        for log in logs:
+    if logs_list:
+        for log in logs_list:
             print log
     else:
         logger.info('\tNo logs')
@@ -62,7 +59,7 @@ def delete(execution_id, model_storage, logger):
     `EXECUTION_ID` is the execution logs to delete.
     """
     logger.info('Deleting logs for execution id {0}'.format(execution_id))
-    logs = model_storage.log.list(filters=dict(execution_fk=execution_id))
-    for log in logs:
+    logs_list = model_storage.log.list(filters=dict(execution_fk=execution_id))
+    for log in logs_list:
         model_storage.log.delete(log)
     logger.info('Deleted logs for execution id {0}'.format(execution_id))

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/commands/node_templates.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/node_templates.py b/aria/cli/commands/node_templates.py
index b97d4a2..cf50ceb 100644
--- a/aria/cli/commands/node_templates.py
+++ b/aria/cli/commands/node_templates.py
@@ -89,8 +89,8 @@ def list(service_template_name, sort_by, descending, model_storage, logger):
         logger.info('Listing all node templates...')
         filters = {}
 
-    node_templates = [nt.to_dict() for nt in model_storage.node_template.list(
+    node_templates_list = [nt.to_dict() for nt in model_storage.node_template.list(
         filters=filters,
         sort=utils.storage_sort_param(sort_by, descending))]
 
-    print_data(NODE_TEMPLATE_COLUMNS, node_templates, 'Node templates:')
+    print_data(NODE_TEMPLATE_COLUMNS, node_templates_list, 'Node templates:')

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/commands/nodes.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/nodes.py b/aria/cli/commands/nodes.py
index 0c9c4e5..fd65e24 100644
--- a/aria/cli/commands/nodes.py
+++ b/aria/cli/commands/nodes.py
@@ -81,8 +81,8 @@ def list(service_name,
         logger.info('Listing all nodes...')
         filters = {}
 
-    nodes = [node.to_dict() for node in model_storage.node.list(
+    nodes_list = [node.to_dict() for node in model_storage.node.list(
         filters=filters,
         sort=utils.storage_sort_param(sort_by, descending))]
 
-    print_data(NODE_COLUMNS, nodes, 'Nodes:')
+    print_data(NODE_COLUMNS, nodes_list, 'Nodes:')

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/commands/plugins.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/plugins.py b/aria/cli/commands/plugins.py
index 4d568d7..9e7d449 100644
--- a/aria/cli/commands/plugins.py
+++ b/aria/cli/commands/plugins.py
@@ -95,7 +95,7 @@ def install(ctx, plugin_path, plugin_manager, logger):
 
     `PLUGIN_PATH` is the path to wagon archive to install.
     """
-    # ctx.invoke(validate, plugin_path=plugin_path)
+    ctx.invoke(validate, plugin_path=plugin_path)
     logger.info('Installing plugin {0}...'.format(plugin_path))
     plugin = plugin_manager.install(plugin_path)
     logger.info("Plugin installed. The plugin's id is {0}".format(plugin.id))
@@ -128,6 +128,6 @@ def list(sort_by, descending, model_storage, logger):
     """List all plugins on the manager
     """
     logger.info('Listing all plugins...')
-    plugins = [p.to_dict() for p in model_storage.plugin.list(
+    plugins_list = [p.to_dict() for p in model_storage.plugin.list(
         sort=storage_sort_param(sort_by, descending))]
-    print_data(PLUGIN_COLUMNS, plugins, 'Plugins:')
+    print_data(PLUGIN_COLUMNS, plugins_list, 'Plugins:')

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/commands/service_templates.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/service_templates.py b/aria/cli/commands/service_templates.py
index a324131..a0e651f 100644
--- a/aria/cli/commands/service_templates.py
+++ b/aria/cli/commands/service_templates.py
@@ -89,9 +89,10 @@ def list(sort_by, descending, model_storage, logger):
         return service_template
 
     logger.info('Listing all service templates...')
-    service_templates = [trim_description(b.to_dict()) for b in model_storage.service_template.list(
-        sort=utils.storage_sort_param(sort_by, descending))]
-    print_data(SERVICE_TEMPLATE_COLUMNS, service_templates, 'Service templates:')
+    service_templates_list = [trim_description(b.to_dict()) for b in
+                              model_storage.service_template.list(
+                                  sort=utils.storage_sort_param(sort_by, descending))]
+    print_data(SERVICE_TEMPLATE_COLUMNS, service_templates_list, 'Service templates:')
 
 
 @service_templates.command(name='store',
@@ -158,7 +159,7 @@ def inputs(service_template_name, model_storage, logger):
     `SERVICE_TEMPLATE_NAME` is the name of the service template to show inputs for.
     """
     logger.info('Showing inputs for service template {0}...'.format(service_template_name))
-    print_service_template_inputs(model_storage, service_template_name)
+    print_service_template_inputs(model_storage, service_template_name, logger)
 
 
 @service_templates.command(name='validate',
@@ -205,7 +206,6 @@ def create_archive(service_template_path, destination, logger):
     logger.info('Csar archive created at {0}'.format(destination))
 
 
-@aria.pass_logger
 def print_service_template_inputs(model_storage, service_template_name, logger):
     service_template = model_storage.service_template.get_by_name(service_template_name)
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/commands/services.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/services.py b/aria/cli/commands/services.py
index e09db21..1059e10 100644
--- a/aria/cli/commands/services.py
+++ b/aria/cli/commands/services.py
@@ -64,10 +64,10 @@ def list(service_template_name,
         logger.info('Listing all service...')
         filters = {}
 
-    services = [d.to_dict() for d in model_storage.service.list(
+    services_list = [d.to_dict() for d in model_storage.service.list(
         sort=storage_sort_param(sort_by=sort_by, descending=descending),
         filters=filters)]
-    print_data(SERVICE_COLUMNS, services, 'Services:')
+    print_data(SERVICE_COLUMNS, services_list, 'Services:')
 
 
 @services.command(name='create',
@@ -82,7 +82,7 @@ def list(service_template_name,
 @aria.pass_logger
 def create(service_template_name,
            service_name,
-           inputs,
+           inputs,  # pylint: disable=redefined-outer-name
            model_storage,
            resource_storage,
            plugin_manager,
@@ -103,7 +103,8 @@ def create(service_template_name,
         handle_storage_exception(e, 'service', service_name)
     except AriaException as e:
         logger.info(str(e))
-        service_templates.print_service_template_inputs(model_storage, service_template_name)
+        service_templates.print_service_template_inputs(model_storage, service_template_name,
+                                                        logger)
         raise AriaCliError(str(e))
     logger.info("Service created. The service's name is {0}".format(service.name))
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/commands/workflows.py
----------------------------------------------------------------------
diff --git a/aria/cli/commands/workflows.py b/aria/cli/commands/workflows.py
index efa373e..2666675 100644
--- a/aria/cli/commands/workflows.py
+++ b/aria/cli/commands/workflows.py
@@ -93,10 +93,11 @@ def list(service_name, model_storage, logger):
     """
     logger.info('Listing workflows for service {0}...'.format(service_name))
     service = model_storage.service.get_by_name(service_name)
-    workflows = [wf.to_dict() for wf in sorted(service.workflows.values(), key=lambda w:
w.name)]
+    workflows_list = [wf.to_dict() for wf in
+                      sorted(service.workflows.values(), key=lambda w: w.name)]
 
     defaults = {
         'service_template_name': service.service_template_name,
         'service_name': service.name
     }
-    print_data(WORKFLOW_COLUMNS, workflows, 'Workflows:', defaults=defaults)
+    print_data(WORKFLOW_COLUMNS, workflows_list, 'Workflows:', defaults=defaults)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/main.py
----------------------------------------------------------------------
diff --git a/aria/cli/main.py b/aria/cli/main.py
index 4544e40..966096c 100644
--- a/aria/cli/main.py
+++ b/aria/cli/main.py
@@ -13,13 +13,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-#TODO handle
+# TODO handle
 if __name__ == '__main__' and __package__ is None:
     import aria.cli
     __package__ = 'aria.cli'
 
 # from . import env
-from . import logger
 from .cli import aria
 from .commands import service_templates
 from .commands import node_templates

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/service_template_utils.py
----------------------------------------------------------------------
diff --git a/aria/cli/service_template_utils.py b/aria/cli/service_template_utils.py
index 4ef4ff1..7f79668 100644
--- a/aria/cli/service_template_utils.py
+++ b/aria/cli/service_template_utils.py
@@ -122,7 +122,7 @@ def generate_id(service_template_path, service_template_filename=SAMPLE_SERVICE_
     """
     service_template_id = os.path.split(os.path.dirname(os.path.abspath(
         service_template_path)))[-1]
-    if not service_template_filename == SAMPLE_SERVICE_TEMPLATE_FILENAME:
+    if service_template_filename != SAMPLE_SERVICE_TEMPLATE_FILENAME:
         filename, _ = os.path.splitext(os.path.basename(service_template_filename))
         service_template_id = (service_template_id + '.' + filename)
     return service_template_id.replace('_', '-')

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/table.py
----------------------------------------------------------------------
diff --git a/aria/cli/table.py b/aria/cli/table.py
index 9c195f5..36dcbea 100644
--- a/aria/cli/table.py
+++ b/aria/cli/table.py
@@ -16,10 +16,10 @@
 import os
 from datetime import datetime
 
-from .env import logger
-
 from prettytable import PrettyTable
 
+from .env import logger
+
 
 def generate(cols, data, defaults=None):
     """
@@ -63,19 +63,19 @@ def generate(cols, data, defaults=None):
         else:
             return defaults[column]
 
-    pt = PrettyTable([col for col in cols])
+    pretty_table = PrettyTable([col for col in cols])
 
-    for d in data:
+    for datum in data:
         values_row = []
-        for c in cols:
-            values_row.append(get_values_per_column(c, d))
-        pt.add_row(values_row)
+        for col in cols:
+            values_row.append(get_values_per_column(col, datum))
+        pretty_table.add_row(values_row)
 
-    return pt
+    return pretty_table
 
 
-def log(title, tb):
-    logger.info('{0}{1}{0}{2}{0}'.format(os.linesep, title, tb))
+def log(title, table):
+    logger.info('{0}{1}{0}{2}{0}'.format(os.linesep, title, table))
 
 
 def print_data(columns, items, header_text, max_width=None, defaults=None):
@@ -84,7 +84,7 @@ def print_data(columns, items, header_text, max_width=None, defaults=None):
     elif not isinstance(items, list):
         items = [items]
 
-    pt = generate(columns, data=items, defaults=defaults)
+    pretty_table = generate(columns, data=items, defaults=defaults)
     if max_width:
-        pt.max_width = max_width
-    log(header_text, pt)
+        pretty_table.max_width = max_width
+    log(header_text, pretty_table)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/cli/utils.py
----------------------------------------------------------------------
diff --git a/aria/cli/utils.py b/aria/cli/utils.py
index 950c295..99315c4 100644
--- a/aria/cli/utils.py
+++ b/aria/cli/utils.py
@@ -76,11 +76,11 @@ def download_file(url, destination=None):
     :rtype: str
 
     """
-    CHUNK_SIZE = 1024
+    chunk_size = 1024
 
     if not destination:
-        fd, destination = tempfile.mkstemp()
-        os.close(fd)
+        file_descriptor, destination = tempfile.mkstemp()
+        os.close(file_descriptor)
     logger.info('Downloading {0} to {1}...'.format(url, destination))
 
     try:
@@ -95,7 +95,7 @@ def download_file(url, destination=None):
 
     try:
         with open(destination, 'wb') as destination_file:
-            for chunk in response.iter_content(CHUNK_SIZE):
+            for chunk in response.iter_content(chunk_size):
                 destination_file.write(chunk)
     except IOError as ex:
         raise AriaCliError(
@@ -140,7 +140,7 @@ def generate_progress_handler(file_path, action='', max_bar_length=80):
                                                   float(total_bytes))))
         percents = min(100.00, round(
             100.00 * (read_bytes / float(total_bytes)), 2))
-        bar = '#' * filled_length + '-' * (bar_length - filled_length)
+        bar = '#' * filled_length + '-' * (bar_length - filled_length)  # pylint: disable=blacklisted-name
 
         # The \r caret makes sure the cursor moves back to the beginning of
         # the line

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/modeling/models.py
----------------------------------------------------------------------
diff --git a/aria/modeling/models.py b/aria/modeling/models.py
index db9db07..773e3dd 100644
--- a/aria/modeling/models.py
+++ b/aria/modeling/models.py
@@ -16,6 +16,10 @@
 # pylint: disable=abstract-method
 
 from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy import (
+    Column,
+    Text
+)
 
 from . import (
     service_template,
@@ -26,11 +30,6 @@ from . import (
     mixins,
 )
 
-from sqlalchemy import (
-    Column,
-    Text
-)
-
 aria_declarative_base = declarative_base(cls=mixins.ModelIDMixin)
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/modeling/orchestration.py
----------------------------------------------------------------------
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index 3ad6b58..12a56f6 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -39,7 +39,6 @@ from sqlalchemy.ext.associationproxy import association_proxy
 from sqlalchemy.ext.declarative import declared_attr
 
 from ..orchestrator.exceptions import (TaskAbortException, TaskRetryException)
-from .types import Dict
 from .mixins import ModelMixin
 from . import (
     relationship,

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/modeling/service_template.py
----------------------------------------------------------------------
diff --git a/aria/modeling/service_template.py b/aria/modeling/service_template.py
index 1c6d393..6271bf7 100644
--- a/aria/modeling/service_template.py
+++ b/aria/modeling/service_template.py
@@ -279,7 +279,7 @@ class ServiceTemplateBase(TemplateModelMixin):
             ('interface_types', formatting.as_raw(self.interface_types)),
             ('artifact_types', formatting.as_raw(self.artifact_types))))
 
-    def instantiate(self, container, inputs=None):
+    def instantiate(self, container, inputs=None):  # pylint: disable=arguments-differ
         from . import models
         context = ConsumptionContext.get_thread_local()
         now = datetime.now()

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/orchestrator/context/common.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/context/common.py b/aria/orchestrator/context/common.py
index 2e33d77..4cb7bce 100644
--- a/aria/orchestrator/context/common.py
+++ b/aria/orchestrator/context/common.py
@@ -183,7 +183,8 @@ class BaseContext(object):
         try:
             return self.resource.service.read(entry_id=str(self.service.id), path=path)
         except exceptions.StorageError:
-            return self.resource.service_template.read(entry_id=str(self.service_template.id),
path=path)
+            return self.resource.service_template.read(entry_id=str(self.service_template.id),
+                                                       path=path)
 
     def get_resource_and_render(self, path=None, variables=None):
         """

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/orchestrator/workflows/api/task.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/api/task.py b/aria/orchestrator/workflows/api/task.py
index 2ec85b9..099bd64 100644
--- a/aria/orchestrator/workflows/api/task.py
+++ b/aria/orchestrator/workflows/api/task.py
@@ -16,7 +16,6 @@
 """
 Provides the tasks to be entered into the task graph
 """
-import copy
 
 from ....modeling import models
 from ....modeling import utils as modeling_utils

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/orchestrator/workflows/builtin/execute_operation.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/builtin/execute_operation.py b/aria/orchestrator/workflows/builtin/execute_operation.py
index 7ee135f..16504ec 100644
--- a/aria/orchestrator/workflows/builtin/execute_operation.py
+++ b/aria/orchestrator/workflows/builtin/execute_operation.py
@@ -18,7 +18,6 @@ Builtin execute_operation workflow
 """
 
 from . import utils
-from ..api.task import OperationTask
 from ... import workflow
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/orchestrator/workflows/builtin/utils.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/builtin/utils.py b/aria/orchestrator/workflows/builtin/utils.py
index 8890084..056eb66 100644
--- a/aria/orchestrator/workflows/builtin/utils.py
+++ b/aria/orchestrator/workflows/builtin/utils.py
@@ -137,4 +137,4 @@ def _is_empty_task(actor, interface_name, operation_name):
 
     raise exceptions.OperationNotFoundException(
         'Could not find operation "{0}" on interface "{1}" for {2} "{3}"'
-            .format(operation_name, interface_name, type(actor).__name__.lower(), actor.name))
+        .format(operation_name, interface_name, type(actor).__name__.lower(), actor.name))

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/utils/archive.py
----------------------------------------------------------------------
diff --git a/aria/utils/archive.py b/aria/utils/archive.py
index 5077dec..63d9004 100644
--- a/aria/utils/archive.py
+++ b/aria/utils/archive.py
@@ -32,15 +32,15 @@ def extract_archive(source):
 
 
 def tar(source, destination):
-    with closing(tarfile.open(destination, 'w:gz')) as tar:
-        tar.add(source, arcname=os.path.basename(source))
+    with closing(tarfile.open(destination, 'w:gz')) as tar_archive:
+        tar_archive.add(source, arcname=os.path.basename(source))
 
 
 def untar(archive, destination=None):
     if not destination:
         destination = tempfile.mkdtemp()
-    with closing(tarfile.open(name=archive)) as tar:
-        tar.extractall(path=destination, members=tar.getmembers())
+    with closing(tarfile.open(name=archive)) as tar_archive:
+        tar_archive.extractall(path=destination, members=tar_archive.getmembers())
     return destination
 
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/utils/formatting.py
----------------------------------------------------------------------
diff --git a/aria/utils/formatting.py b/aria/utils/formatting.py
index 698393f..f0ef146 100644
--- a/aria/utils/formatting.py
+++ b/aria/utils/formatting.py
@@ -84,7 +84,7 @@ def full_type_name(value):
 
 
 def decode_list(data):
-    rv = []
+    decoded_list = []
     for item in data:
         if isinstance(item, unicode):
             item = item.encode('utf-8')
@@ -92,12 +92,12 @@ def decode_list(data):
             item = decode_list(item)
         elif isinstance(item, dict):
             item = decode_dict(item)
-        rv.append(item)
-    return rv
+        decoded_list.append(item)
+    return decoded_list
 
 
 def decode_dict(data):
-    rv = {}
+    decoded_dict = {}
     for key, value in data.iteritems():
         if isinstance(key, unicode):
             key = key.encode('utf-8')
@@ -107,8 +107,8 @@ def decode_dict(data):
             value = decode_list(value)
         elif isinstance(value, dict):
             value = decode_dict(value)
-        rv[key] = value
-    return rv
+        decoded_dict[key] = value
+    return decoded_dict
 
 
 def try_convert_from_str(string, target_type):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/utils/threading.py
----------------------------------------------------------------------
diff --git a/aria/utils/threading.py b/aria/utils/threading.py
index f4e9c0e..06c48bc 100644
--- a/aria/utils/threading.py
+++ b/aria/utils/threading.py
@@ -277,5 +277,5 @@ class ExceptionThread(Thread):
 
     def raise_error_if_exists(self):
         if self.is_error():
-            t, v, tb = self.exception
-            raise t, v, tb
+            type_, value, tb = self.exception
+            raise type_, value, tb

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/45f61a0f/aria/utils/type.py
----------------------------------------------------------------------
diff --git a/aria/utils/type.py b/aria/utils/type.py
index 494a2c2..292225a 100644
--- a/aria/utils/type.py
+++ b/aria/utils/type.py
@@ -38,7 +38,7 @@ def validate_value_type(value, type_name):
     try:
         type(value)
     except ValueError:
-        raise False
+        raise
 
 
 def convert_value_to_type(str_value, type_name):


Mime
View raw message