From bab253ac9fd825890b36f8354f1f109752aadff7 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 14 Dec 2016 10:21:25 +0200 Subject: Fixes to various issues reported by pyflakes Pyflake is a python (2) source checker. This patch fixes various (mostly trivial) errors and warnings it reports. Change-Id: Ia35c5ac61751b927814cf693994c632c412386ea --- rest-api-templates/asterisk_processor.py | 1 + rest-api-templates/swagger_model.py | 2 +- rest-api-templates/transform.py | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) (limited to 'rest-api-templates') diff --git a/rest-api-templates/asterisk_processor.py b/rest-api-templates/asterisk_processor.py index 68a679994..981294673 100644 --- a/rest-api-templates/asterisk_processor.py +++ b/rest-api-templates/asterisk_processor.py @@ -20,6 +20,7 @@ Asterisk RESTful HTTP binding code. """ +import os import re from swagger_model import * diff --git a/rest-api-templates/swagger_model.py b/rest-api-templates/swagger_model.py index c71352a01..08852415c 100644 --- a/rest-api-templates/swagger_model.py +++ b/rest-api-templates/swagger_model.py @@ -737,7 +737,7 @@ class ResourceListing(Stringify): self.swagger_version = resources_json.get('swaggerVersion') if not self.swagger_version in SWAGGER_VERSIONS: raise SwaggerError( - "Unsupported Swagger version %s" % swagger_version, context) + "Unsupported Swagger version %s" % self.swagger_version, context) validate_required_fields(resources_json, self.required_fields, context) self.api_version = resources_json['apiVersion'] diff --git a/rest-api-templates/transform.py b/rest-api-templates/transform.py index fc12efe85..c3a030064 100644 --- a/rest-api-templates/transform.py +++ b/rest-api-templates/transform.py @@ -52,7 +52,6 @@ class Transform(object): dest_exists = os.path.exists(dest_file) if dest_exists and not self.overwrite: return - tmp_file = tempfile.mkstemp() with tempfile.NamedTemporaryFile() as out: out.write(renderer.render(self.template, model)) out.flush() -- cgit v1.2.3