use invirt config
authorYang Zhang <y_z@mit.edu>
Sun, 3 Aug 2008 04:32:21 +0000 (00:32 -0400)
committerYang Zhang <y_z@mit.edu>
Sun, 3 Aug 2008 04:32:21 +0000 (00:32 -0400)
svn path=/trunk/packages/sipb-xen-remote-server/; revision=830

config.todo [deleted file]
files/usr/sbin/sipb-xen-remconffs
files/usr/sbin/sipb-xen-remctl-help
files/usr/sbin/sipb-xen-remote-proxy

diff --git a/config.todo b/config.todo
deleted file mode 100644 (file)
index 32fd3e3..0000000
+++ /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
index df07f54..cddc53f 100755 (executable)
@@ -13,6 +13,7 @@ import errno   # for error number codes (ENOENT, etc)
 from syslog import *
 
 import sipb_xen_database
 from syslog import *
 
 import sipb_xen_database
+from invirt.config import structs as config
 
 fuse.fuse_python_api = (0, 2)
 
 
 fuse.fuse_python_api = (0, 2)
 
@@ -120,7 +121,7 @@ class RemConfFS(Fuse):
                        (princ, realm) = user.split('@')
                else:
                        princ = user
                        (princ, realm) = user.split('@')
                else:
                        princ = user
-                       realm = "ATHENA.MIT.EDU"
+                       realm = config.authn[0].realm
                
                return princ.replace('.', '/') + '@' + realm
        
                
                return princ.replace('.', '/') + '@' + realm
        
@@ -227,7 +228,7 @@ class RemConfFS(Fuse):
 
 
 if __name__ == '__main__':
 
 
 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]
 """
        usage="""
 $0 [mount_path]
 """
index d390a65..2646fbd 100755 (executable)
@@ -3,7 +3,7 @@
 Help on using the Invirt remctl functions.
 """
 import sys
 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)'),
 
 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]
 
 def main(args):
     args = [n for n in args if n in helpdict]
-    print 'remctl remote control <machine> <command>'
+    print 'remctl %s control <machine> <command>' % config.remote.hostname
     if args:
         for name in args:
             print_help(name, helpdict[name])
     if args:
         for name in args:
             print_help(name, helpdict[name])
index a115782..c94a764 100755 (executable)
@@ -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
 # 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" "$@" ;;
     * )
        # 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
 esac