Commit 8ca4aae3 authored by Rémi Duraffort's avatar Rémi Duraffort Committed by Neil Williams
Browse files

Fix undefined variables

Change-Id: Idb03006480388cab7500a6bfb74a97952bc59598
parent c7ede888
......@@ -392,7 +392,7 @@ class BzrRepoAction(RepoAction): # pylint: disable=too-many-public-methods
connection = super().run(connection, max_end_time)
# NOTE: the runner_path dir must remain empty until after the VCS clone, so let the VCS clone create the final dir
runner_path = self.get_namespace_data(action='uuid', label='overlay_path', key=args['test_name'])
runner_path = self.get_namespace_data(action='uuid', label='overlay_path', key=self.parameters['test_name'])
commit_id = self.vcs.clone(
runner_path,
......
......@@ -250,7 +250,7 @@ class ResultsAPI(ExposedAPI):
query.refresh_view()
except QueryUpdatedError as e:
raise xmlrpc.client.Fault(
400, "Query with name %s owned by user %s was recently refreshed." % (query_name, username))
400, "Query with name %s owned by user %s was recently refreshed." % (query.name, username))
except Exception as e:
raise xmlrpc.client.Fault(
401, "Refresh operation for query with name %s owned by user %s failed. Please contact system administrator. Error: %s" % (query.name, query.owner.username, str(e)))
......
......@@ -2102,7 +2102,7 @@ def edit_worker_desc(request):
if worker_obj.can_admin(request.user):
worker_obj.description = value
worker.save()
worker_obj.save()
return HttpResponse(worker_obj.get_description())
else:
return HttpResponseForbidden("Permission denied.",
......
......@@ -102,7 +102,7 @@ class Command(BaseCommand):
raise CommandError("TestJob '%d' does not exists" % job_id)
def handle_rm(self, older_than, submitter, state, simulate, slow):
if not older_than and not submitter and not state and not v1_only:
if not older_than and not submitter and not state:
raise CommandError("You should specify at least one filtering option")
if simulate:
......
......@@ -22,6 +22,7 @@ import contextlib
import django
import os
import psycopg2
import pwd
import random
import shutil
import stat
......@@ -81,7 +82,6 @@ def db_setup(config, pg_admin_username, pg_admin_password):
cursor.execute("CREATE ROLE %s NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN ENCRYPTED PASSWORD '%s'" % (config.LAVA_DB_USER, config.LAVA_DB_PASSWORD))
except psycopg2.ProgrammingError:
print("LAVA db user password not set in db")
pass
cursor.execute("SELECT EXISTS(SELECT * FROM information_schema.tables WHERE table_name='%s')" % config.LAVA_DB_NAME)
db_existed_before = cursor.fetchone()[0]
......@@ -91,7 +91,6 @@ def db_setup(config, pg_admin_username, pg_admin_password):
cursor.execute("CREATE DATABASE \"%s\" LC_CTYPE 'C.UTF-8' ENCODING 'UTF-8' OWNER \"%s\" TEMPLATE template0" % (config.LAVA_DB_NAME, config.LAVA_DB_USER))
except psycopg2.ProgrammingError as e:
print(e)
pass
conn = psycopg2.connect("dbname='%s' user='%s' host='%s' password='%s' connect_timeout=5" % (
config.LAVA_DB_NAME,
......@@ -189,7 +188,6 @@ def configure():
config.LAVA_SYS_USER)
except FileNotFoundError:
print("legacy directory is missing, skip..")
pass
# support changes in xml-rpc API for 2017.6
shutil.chown("/etc/lava-server/dispatcher.d/",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment