freifunk / meshkit

Meshkit is a generator for preconfigured images that can be used for freifunk
Other
45 stars 12 forks source link

local variable 'vap' referenced before assignment in wizard without community support #7

Closed Squonk42 closed 10 years ago

Squonk42 commented 10 years ago

Error ticket for "meshkit" Ticket ID 127.0.0.1.2014-03-01.10-26-04.1b94b435-680b-441b-9418-295e83fdd6bc

<type 'exceptions.UnboundLocalError'> local variable 'vap' referenced before assignment

Version web2py™ Version 2.8.2-stable+timestamp.2013.11.28.13.54.07 Traceback Traceback (most recent call last): File "/root/web2py/gluon/restricted.py", line 217, in restricted exec ccode in environment File "/root/web2py/applications/meshkit/controllers/default.py", line 327, in File "/root/web2py/gluon/globals.py", line 372, in self._caller = lambda f: f() File "/root/web2py/applications/meshkit/controllers/default.py", line 170, in wizard if vap == '1': UnboundLocalError: local variable 'vap' referenced before assignment In file: /root/web2py/applications/meshkit/controllers/default.py

Squonk42 commented 10 years ago

same problem with nodenumber

Squonk42 commented 10 years ago

Proposed patch:

From e41f19e512152bd842d2ded5c84efaeb8807f408 Mon Sep 17 00:00:00 2001
From: Michel Stempin <michel.stempin@wanadoo.fr>
Date: Sat, 1 Mar 2014 11:45:55 -0500
Subject: [PATCH] Added default values for wizard if no community set

Signed-off-by: Michel Stempin <michel.stempin@wanadoo.fr>
---
 controllers/default.py |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/controllers/default.py b/controllers/default.py
index ef8737b..c4f99c8 100644
--- a/controllers/default.py
+++ b/controllers/default.py
@@ -144,6 +144,8 @@ def wizard():
         session.communitysupport == False
         lucipackages = config.lucipackages
         community_defaults = dict()
+        vap = 0
+        nodenumber = ''

     session.localrestrict=True

-- 
1.7.9.5
mmunz commented 10 years ago

Committed, thanks!