Skip to content

Commit e0c53eb

Browse files
committed
Code quality fixes.
1 parent 66adf24 commit e0c53eb

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/runscript.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
import subprocess
1111

1212

13-
log = logging.getLogger('RUNSCRIPT')
14-
15-
1613
def run_as(uid, gid, groups):
1714
"""Closure that changes the current running user and groups. Called before
1815
executing scripts by Subprocess."""
@@ -33,6 +30,8 @@ def run_script(form_def, form_values, stdout=None, stderr=None):
3330
callback should be written. The output of the script is hooked up to
3431
the output, depending on the output type.
3532
"""
33+
log = logging.getLogger('RUNSCRIPT')
34+
3635
# Validate params
3736
if form_def.output == 'raw' and (stdout is None or stderr is None):
3837
msg = 'stdout and stderr cannot be none if script output ' \

src/scriptform.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def main(): # pragma: no cover
216216

217217
# If a form configuration was specified, change to that dir so we can
218218
# find the job scripts and such.
219-
if len(args) > 0:
219+
if args:
220220
path = os.path.dirname(args[0])
221221
if path:
222222
os.chdir(path)
@@ -246,5 +246,6 @@ def main(): # pragma: no cover
246246
log.exception(err)
247247
raise
248248

249+
249250
if __name__ == "__main__": # pragma: no cover
250251
main()

src/webapp.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
{footer}
160160
'''
161161

162+
162163
def censor_form_values(form_def, form_values):
163164
"""
164165
Remove sensitive field values from form_values dict.
@@ -433,7 +434,7 @@ def h_submit(self, form_values):
433434
log.info("Calling script: %s", form_def.script)
434435
log.info("Current working dir: %s", cwd)
435436
log.info("User: %s", username)
436-
log.info("Variables: %s", censor_form_values(form_def, form_values))
437+
log.info("Vars: %s", censor_form_values(form_def, form_values))
437438

438439
form_def = form_config.get_form_def(form_name)
439440
result = runscript.run_script(form_def, form_values, self.wfile,

0 commit comments

Comments
 (0)