summaryrefslogtreecommitdiff
path: root/rest-api-templates
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir.cohen@xorcom.com>2016-12-14 10:21:25 +0200
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>2016-12-21 11:02:20 +0200
commitbab253ac9fd825890b36f8354f1f109752aadff7 (patch)
treec44404c7a7cb6673275877b6ef029cb9cb2a3c18 /rest-api-templates
parent500c6af9dbc049d4e608e322f45778072e6508ec (diff)
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
Diffstat (limited to 'rest-api-templates')
-rw-r--r--rest-api-templates/asterisk_processor.py1
-rw-r--r--rest-api-templates/swagger_model.py2
-rw-r--r--rest-api-templates/transform.py1
3 files changed, 2 insertions, 2 deletions
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()