chiark
/
gitweb
/
~mdw
/
tripe
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.distorted.org.uk:~mdw/publish/public-git/tripe
[tripe]
/
svc
/
connect.in
diff --git
a/svc/connect.in
b/svc/connect.in
index 5f8940e34ddc5b527e50275fe2bd85b243203940..0031d36fcee85b72aa226a79f747742c11af2352 100644
(file)
--- a/
svc/connect.in
+++ b/
svc/connect.in
@@
-130,6
+130,16
@@
def cmd_info(name):
for i in items:
T.svcinfo('%s=%s' % (i, peer.get(i)))
for i in items:
T.svcinfo('%s=%s' % (i, peer.get(i)))
+def cmd_userpeer(user):
+ """
+ userpeer USER: Report the peer name for the named user.
+ """
+ try:
+ peer = CDB.init(opts.cdb)['U' + user]
+ except KeyError:
+ raise T.TripeJobError('unknown-user', user)
+ T.svcinfo(peer)
+
## Dictionary mapping challenges to waiting passive-connection coroutines.
chalmap = {}
## Dictionary mapping challenges to waiting passive-connection coroutines.
chalmap = {}
@@
-241,7
+251,8
@@
service_info = [('connect', VERSION, {
'passive': (1, None, '[OPTIONS] USER', cmd_passive),
'active': (1, 1, 'PEER', cmd_active),
'info': (1, 1, 'PEER', cmd_info),
'passive': (1, None, '[OPTIONS] USER', cmd_passive),
'active': (1, 1, 'PEER', cmd_active),
'info': (1, 1, 'PEER', cmd_info),
- 'list': (0, 0, '', cmd_list)
+ 'list': (0, 0, '', cmd_list),
+ 'userpeer': (1, 1, 'USER', cmd_userpeer)
})]
if __name__ == '__main__':
})]
if __name__ == '__main__':