From d9c91f069b5825d2c87e419d10c77850ecff7006 Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Sun, 3 Aug 2008 00:32:21 -0400 Subject: [PATCH] use invirt config svn path=/trunk/packages/sipb-xen-remote-server/; revision=830 --- config.todo | 4 ---- files/usr/sbin/sipb-xen-remconffs | 5 +++-- files/usr/sbin/sipb-xen-remctl-help | 4 ++-- files/usr/sbin/sipb-xen-remote-proxy | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) delete mode 100644 config.todo diff --git a/config.todo b/config.todo deleted file mode 100644 index 32fd3e3..0000000 --- a/config.todo +++ /dev/null @@ -1,4 +0,0 @@ -files/usr/sbin/sipb-xen-remconffs: realm -files/usr/sbin/sipb-xen-remconffs: db uri -files/usr/sbin/sipb-xen-remote-proxy: any one host name -files/usr/sbin/sipb-xen-remctl-help: remote-proxy hostname diff --git a/files/usr/sbin/sipb-xen-remconffs b/files/usr/sbin/sipb-xen-remconffs index df07f54..cddc53f 100755 --- a/files/usr/sbin/sipb-xen-remconffs +++ b/files/usr/sbin/sipb-xen-remconffs @@ -13,6 +13,7 @@ import errno # for error number codes (ENOENT, etc) from syslog import * import sipb_xen_database +from invirt.config import structs as config fuse.fuse_python_api = (0, 2) @@ -120,7 +121,7 @@ class RemConfFS(Fuse): (princ, realm) = user.split('@') else: princ = user - realm = "ATHENA.MIT.EDU" + realm = config.authn[0].realm return princ.replace('.', '/') + '@' + realm @@ -227,7 +228,7 @@ class RemConfFS(Fuse): if __name__ == '__main__': - sipb_xen_database.connect('postgres://sipb-xen@sipb-xen-dev.mit.edu/sipb_xen') + sipb_xen_database.connect(db.uri) usage=""" $0 [mount_path] """ diff --git a/files/usr/sbin/sipb-xen-remctl-help b/files/usr/sbin/sipb-xen-remctl-help index d390a65..2646fbd 100755 --- a/files/usr/sbin/sipb-xen-remctl-help +++ b/files/usr/sbin/sipb-xen-remctl-help @@ -3,7 +3,7 @@ Help on using the Invirt remctl functions. """ import sys - +from invirt.config import structs as config help = [ ('list', 'show your VM\'s state (with xm list)'), @@ -26,7 +26,7 @@ def print_help(name, text): def main(args): args = [n for n in args if n in helpdict] - print 'remctl remote control ' + print 'remctl %s control ' % config.remote.hostname if args: for name in args: print_help(name, helpdict[name]) diff --git a/files/usr/sbin/sipb-xen-remote-proxy b/files/usr/sbin/sipb-xen-remote-proxy index a115782..c94a764 100755 --- a/files/usr/sbin/sipb-xen-remote-proxy +++ b/files/usr/sbin/sipb-xen-remote-proxy @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # invoke as sipb-xen-remote-proxy-$TYPE, with "TYPE" in the remctl sense. klist -s || kinit -k @@ -22,5 +22,5 @@ case "$TYPE/$SERVICE" in # Everything but create must go where the VM is already running. sipb-xen-remote-control "$MACHINE" "$SERVICE" "$@" ;; * ) - remctl black-mesa remote "$TYPE" "$SERVICE" "$@" ;; + remctl "$(invirt-getconf hosts.0.hostname)" remote "$TYPE" "$SERVICE" "$@" ;; esac -- 1.7.9.5