From: Mark Wooding Date: Mon, 22 Dec 2014 20:32:58 +0000 (+0000) Subject: service.py: Fix commentary, and default remote command. X-Git-Tag: 1.2.0~23 X-Git-Url: https://git.distorted.org.uk/~mdw/chopwood/commitdiff_plain/1e83d6d9ae0d486fc1205e70123a356220db3bff service.py: Fix commentary, and default remote command. --- diff --git a/service.py b/service.py index ddd28b9..786ab92 100644 --- a/service.py +++ b/service.py @@ -284,6 +284,14 @@ class SSHRemoteService (BasicRemoteService): `clear SERVICE USER' Clear the USER's password for SERVICE. + `mkpwent USER SERVICE [FIELDS ...]' + Install a record for USER in the SERVICE, supplying any other + necessary FIELDS in the appropriate format. The user's password is + provided on the next line of standard input. + + `rmpwent USER SERVICE' + Remove USER's password record for SERVICE. + Arguments are form-url-encoded, since SSH doesn't preserve token boundaries in its argument list. @@ -352,14 +360,15 @@ class CommandRemoteService (BasicRemoteService): commands, then your easy approach is to set commands for the operations you can handle in the OPMAP, and set the DEFAULT to something like - ['echo', 'ERR 500', 'unsupported command:'] + ['echo', 'ERR', '500', 'unsupported command:'] to reject other commands. """ R_PAT = RX.compile('%(.)') - def __init__(me, default = ['ERR', '500', 'unimplemented command:'], + def __init__(me, + default = ['echo', 'ERR', '500', 'unimplemented command:'], opmap = {}, *args, **kw): """Initialize the command remote service.""" super(CommandRemoteService, me).__init__(*args, **kw)