Index: trunk/packages/invirt-console-server/files/usr/bin/invirt-consolefs
===================================================================
--- trunk/packages/invirt-console-server/files/usr/bin/invirt-consolefs	(revision 1725)
+++ trunk/packages/invirt-console-server/files/usr/bin/invirt-consolefs	(revision 1726)
@@ -16,79 +16,79 @@
 
 class ConsoleFS(routefs.RouteFS):
-	"""
-	ConsoleFS creates a series of subdirectories each mirroring the same real
-	directory, except for a single file - the .k5login - which is dynamically
-	generated for each subdirectory
-	"""
-	
-	def __init__(self, *args, **kw):
-		"""Initialize the filesystem and set it to allow_other access besides
-		the user who mounts the filesystem (i.e. root)
-		"""
-		super(ConsoleFS, self).__init__(*args, **kw)
-		self.lasttime = 0
-		self.machines = []
-		self.fuse_args.add("allow_other", True)
-		
-		openlog('invirt-consolefs ', LOG_PID, LOG_DAEMON)
-		
-		syslog(LOG_DEBUG, 'Init complete.')
-	
-	def make_map(self):
-		m = Mapper()
-		m.connect('', controller='getMachines')
-		m.connect(':machine', controller='getMirror')
-		m.connect(':machine/.k5login', controller='getK5login')
-		m.connect(':machine/*(path)', controller='getMirror')
-		return m
-	
-	def recache(self):
-		if time() - self.lasttime > 5:
-			self.lasttime = time()
-			database.clear_cache()
-			self.machines = dict((machine.name, machine) for machine in database.session.query(database.Machine).all())
+    """
+    ConsoleFS creates a series of subdirectories each mirroring the same real
+    directory, except for a single file - the .k5login - which is dynamically
+    generated for each subdirectory
+    """
+    
+    def __init__(self, *args, **kw):
+        """Initialize the filesystem and set it to allow_other access besides
+        the user who mounts the filesystem (i.e. root)
+        """
+        super(ConsoleFS, self).__init__(*args, **kw)
+        self.lasttime = 0
+        self.machines = []
+        self.fuse_args.add("allow_other", True)
+        
+        openlog('invirt-consolefs ', LOG_PID, LOG_DAEMON)
+        
+        syslog(LOG_DEBUG, 'Init complete.')
+    
+    def make_map(self):
+        m = Mapper()
+        m.connect('', controller='getMachines')
+        m.connect(':machine', controller='getMirror')
+        m.connect(':machine/.k5login', controller='getK5login')
+        m.connect(':machine/*(path)', controller='getMirror')
+        return m
+    
+    def recache(self):
+        if time() - self.lasttime > 5:
+            self.lasttime = time()
+            database.clear_cache()
+            self.machines = dict((machine.name, machine) for machine in database.session.query(database.Machine).all())
 
-	def getMachines(self, **kw):
-		self.recache()
-		return self.machines.keys()
-	
-	def getMirror(self, machine, path='', **kw):
-		"""Translate the path into its realpath equivalent, and return that
-		"""
-		real = realpath + path
-		if os.path.isdir(real):
-			# The list is converted to a set so that we can handle the case 
-			# where there is already a .k5login in the realpath gracefully	  
-			return routefs.Directory(set(os.listdir(real) + ['.k5login']))
-		elif os.path.islink(real):
-			return routefs.Symlink(os.readlink(real))
-		elif os.path.isfile(real):
-			return open(real).read()
-		else:
-			return -errno.EINVAL
-	
- 	def getK5login(self, machine, **kw):
-		self.recache()
-		machine = self.machines[machine]
-		users = [acl.user for acl in machine.acl]
-		return "\n".join(map(self.userToPrinc, users) + [''])
-	
-	def mirrorPath(self, path):
-		"""Translate a virtual path to its real path counterpart"""
-		return realpath + "/".join(getParts(path)[1:])
-	
-	def userToPrinc(self, user):
-		"""Convert Kerberos v4-style names to v5-style and append a default
-		realm if none is specified
-		"""
-		if '@' in user:
-			(princ, realm) = user.split('@')
-		else:
-			princ = user
-			realm = config.authn[0].realm
-		
-		return princ.replace('.', '/') + '@' + realm
+    def getMachines(self, **kw):
+        self.recache()
+        return self.machines.keys()
+    
+    def getMirror(self, machine, path='', **kw):
+        """Translate the path into its realpath equivalent, and return that
+        """
+        real = realpath + path
+        if os.path.isdir(real):
+            # The list is converted to a set so that we can handle the case 
+            # where there is already a .k5login in the realpath gracefully    
+            return routefs.Directory(set(os.listdir(real) + ['.k5login']))
+        elif os.path.islink(real):
+            return routefs.Symlink(os.readlink(real))
+        elif os.path.isfile(real):
+            return open(real).read()
+        else:
+            return -errno.EINVAL
+    
+    def getK5login(self, machine, **kw):
+        self.recache()
+        machine = self.machines[machine]
+        users = [acl.user for acl in machine.acl]
+        return "\n".join(map(self.userToPrinc, users) + [''])
+    
+    def mirrorPath(self, path):
+        """Translate a virtual path to its real path counterpart"""
+        return realpath + "/".join(getParts(path)[1:])
+    
+    def userToPrinc(self, user):
+        """Convert Kerberos v4-style names to v5-style and append a default
+        realm if none is specified
+        """
+        if '@' in user:
+            (princ, realm) = user.split('@')
+        else:
+            princ = user
+            realm = config.authn[0].realm
+        
+        return princ.replace('.', '/') + '@' + realm
 
 if __name__ == '__main__':
-	database.connect()
-	routefs.main(ConsoleFS)
+    database.connect()
+    routefs.main(ConsoleFS)
Index: trunk/packages/invirt-remote-server/files/usr/sbin/invirt-remconffs
===================================================================
--- trunk/packages/invirt-remote-server/files/usr/sbin/invirt-remconffs	(revision 1725)
+++ trunk/packages/invirt-remote-server/files/usr/sbin/invirt-remconffs	(revision 1726)
@@ -11,82 +11,82 @@
 
 class RemConfFS(routefs.RouteFS):
-	"""
-	RemConfFS creates a filesytem for configuring remctl, like this:
-	/
-	|-- acl
-	|   |-- machine1
-	|   ...
-	|   `-- machinen
-	`-- conf
-	
-	The machine list and the acls are drawn from a database.
-	"""
-	
-	def __init__(self, *args, **kw):
-		"""Initialize the filesystem and set it to allow_other access besides
-		the user who mounts the filesystem (i.e. root)
-		"""
-		super(RemConfFS, self).__init__(*args, **kw)
-		self.lasttime = 0
-		self.fuse_args.add("allow_other", True)
-		
-		openlog('invirt-remconffs ', LOG_PID, LOG_DAEMON)
-		
-		syslog(LOG_DEBUG, 'Init complete.')
-	
-	def make_map(self):
-		m = Mapper()
-		m.connect('', controller='getroot')
-		m.connect('acl', controller='getmachines')
-		m.connect('acl/:machine', controller='getacl')
-		m.connect('conf', controller='getconf')
-		return m
-	
-	def recache(self):
-		if time() - self.lasttime > 5:
-			self.lasttime = time()
-			database.clear_cache()
-			self.machines = dict((machine.name, machine) for machine in database.session.query(database.Machine).all())
-	
-	def getroot(self, **kw):
-		return ['acl', 'conf']
-	
-	def getacl(self, machine, **kw):
-		"""Build the ACL file for a machine
-		"""
-		self.recache()
-		machine = self.machines[machine]
-		users = [acl.user for acl in machine.acl]
-		return "\n".join(map(self.userToPrinc, users)
-				 + ['include /etc/remctl/acl/web',
-					''])
-	
-	def getconf(self, **kw):
-		"""Build the master conf file, with all machines
-		"""
-		return '\n'.join("control %s /usr/sbin/invirt-remote-proxy-control"
-				 " /etc/remctl/remconffs/acl/%s"
-				 % (machine_name, machine_name)
-				 for machine_name in self.getmachines())+'\n'
-	
-	def getmachines(self, **kw):
-		"""Get the list of VMs in the database, clearing the cache if it's 
-		older than 15 seconds"""
-		self.recache()
-		return self.machines.keys()
-	
-	def userToPrinc(self, user):
-		"""Convert Kerberos v4-style names to v5-style and append a default
-		realm if none is specified
-		"""
-		if '@' in user:
-			(princ, realm) = user.split('@')
-		else:
-			princ = user
-			realm = config.authn[0].realm
-		
-		return princ.replace('.', '/') + '@' + realm
+    """
+    RemConfFS creates a filesytem for configuring remctl, like this:
+    /
+    |-- acl
+    |   |-- machine1
+    |   ...
+    |   `-- machinen
+    `-- conf
+    
+    The machine list and the acls are drawn from a database.
+    """
+    
+    def __init__(self, *args, **kw):
+        """Initialize the filesystem and set it to allow_other access besides
+        the user who mounts the filesystem (i.e. root)
+        """
+        super(RemConfFS, self).__init__(*args, **kw)
+        self.lasttime = 0
+        self.fuse_args.add("allow_other", True)
+        
+        openlog('invirt-remconffs ', LOG_PID, LOG_DAEMON)
+        
+        syslog(LOG_DEBUG, 'Init complete.')
+    
+    def make_map(self):
+        m = Mapper()
+        m.connect('', controller='getroot')
+        m.connect('acl', controller='getmachines')
+        m.connect('acl/:machine', controller='getacl')
+        m.connect('conf', controller='getconf')
+        return m
+    
+    def recache(self):
+        if time() - self.lasttime > 5:
+            self.lasttime = time()
+            database.clear_cache()
+            self.machines = dict((machine.name, machine) for machine in database.session.query(database.Machine).all())
+    
+    def getroot(self, **kw):
+        return ['acl', 'conf']
+    
+    def getacl(self, machine, **kw):
+        """Build the ACL file for a machine
+        """
+        self.recache()
+        machine = self.machines[machine]
+        users = [acl.user for acl in machine.acl]
+        return "\n".join(map(self.userToPrinc, users)
+                 + ['include /etc/remctl/acl/web',
+                    ''])
+    
+    def getconf(self, **kw):
+        """Build the master conf file, with all machines
+        """
+        return '\n'.join("control %s /usr/sbin/invirt-remote-proxy-control"
+                 " /etc/remctl/remconffs/acl/%s"
+                 % (machine_name, machine_name)
+                 for machine_name in self.getmachines())+'\n'
+    
+    def getmachines(self, **kw):
+        """Get the list of VMs in the database, clearing the cache if it's 
+        older than 15 seconds"""
+        self.recache()
+        return self.machines.keys()
+    
+    def userToPrinc(self, user):
+        """Convert Kerberos v4-style names to v5-style and append a default
+        realm if none is specified
+        """
+        if '@' in user:
+            (princ, realm) = user.split('@')
+        else:
+            princ = user
+            realm = config.authn[0].realm
+        
+        return princ.replace('.', '/') + '@' + realm
 
 if __name__ == '__main__':
-	database.connect()
-	routefs.main(RemConfFS)
+    database.connect()
+    routefs.main(RemConfFS)
