From 71d74dcfa355c55076eca33939f56d6f8a7b87ce Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 12 Mar 2013 22:17:16 +0000 Subject: [PATCH] Fix some stupid unknown-variable errors. Leftover from the split into separate modules. --- chpwd | 11 ++++++----- cmd-remote.py | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/chpwd b/chpwd index 4d70fa8..3872715 100755 --- a/chpwd +++ b/chpwd @@ -38,6 +38,7 @@ import config as CONF; CFG = CONF.CFG import dbmaint as D import httpauth as HA import output as O; OUT = O.OUT +import service as S import subcommand as SC import util as U @@ -229,7 +230,7 @@ if __name__ == '__main__': OPTS, args = OPTPARSE.parse_args() CONF.loadconfig(OPTS.config) cmd = SL.split(ENV['SSH_ORIGINAL_COMMAND']) - if args: raise ExpectedError, (500, 'Unexpected arguments via SSH') + if args: raise U.ExpectedError, (500, 'Unexpected arguments via SSH') return cmd if 'CHPWD_SSH_USER' in ENV: @@ -239,7 +240,7 @@ if __name__ == '__main__': with cli_errors(): cmd = ssh_setup() CU.set_user(ENV['CHPWD_SSH_USER']) - SERVICES['master'].find(USER) + S.SERVICES['master'].find(CU.USER) with OUT.redirect_to(O.FileOutput()): OPTPARSE.dispatch('userv', cmd) @@ -252,8 +253,8 @@ if __name__ == '__main__': try: cmd = ssh_setup() with OUT.redirect_to(O.RemoteOutput()): - OPTPARSE.dispatch('remote', map(urldecode, cmd)) - except ExpectedError, e: + OPTPARSE.dispatch('remote', map(CGI.urldecode, cmd)) + except U.ExpectedError, e: print 'ERR', e.code, e.msg else: print 'OK' @@ -263,7 +264,7 @@ if __name__ == '__main__': ## file, but we can't do much about it from here. with cli_errors(): - raise ExpectedError, (400, "Unabled to determine SSH context") + raise U.ExpectedError, (400, "Unabled to determine SSH context") else: ## Plain old command line, apparently. We default to administration diff --git a/cmd-remote.py b/cmd-remote.py index b140329..6463d53 100644 --- a/cmd-remote.py +++ b/cmd-remote.py @@ -32,7 +32,7 @@ import util as U 'Set password for remote service', params = [SC.Arg('service'), SC.Arg('user')]) def cmd_set_svc(service, user): - new = readline() + new = U.readline('new password') svc = CU.check_service(service) svc.setpasswd(user, new) -- 2.11.0