Trees | Indices | Help |
---|
|
1 # -*- Mode: Python -*- 2 # vi:si:et:sw=4:sts=4:ts=4 3 4 # Flumotion - a streaming media server 5 # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. 6 # Copyright (C) 2010,2011 Flumotion Services, S.A. 7 # All rights reserved. 8 # 9 # This file may be distributed and/or modified under the terms of 10 # the GNU Lesser General Public License version 2.1 as published by 11 # the Free Software Foundation. 12 # This file is distributed without any warranty; without even the implied 13 # warranty of merchantability or fitness for a particular purpose. 14 # See "LICENSE.LGPL" in the source distribution for more information. 15 # 16 # Headers in this file shall remain intact. 17 18 19 import os 20 from twisted.internet import defer 21 22 from flumotion.component.plugs import base 23 from flumotion.common.manhole import openSSHManhole 24 from flumotion.common.manhole import openAnonymousTelnetManhole 25 26 __version__ = "$Rev$" 27 2830 """ 31 """ 3284 85 95 96 10634 35 self.useSSH = False 36 self.authorizedKeysFile = None 37 self.port = None 38 self.requestedPortNum = None 39 self.namespace = {}4042 self.namespace.update(namespace) 43 props = self.args['properties'] 44 if 'ssh-authorized-keys-file' in props: 45 self.useSSH = True 46 self.authorizedKeysFile = os.path.expanduser( 47 props['ssh-authorized-keys-file']) 48 49 self.requestedPortNum = props.get('port', -1) 50 51 self._insinuate() 52 53 if props.get('initially-open', False): 54 self.openManhole()5557 self.closeManhole()5860 # "And I wish you didn't have the devil's curly hair!" 61 from flumotion.manager.admin import AdminAvatar 62 AdminAvatar.perspective_openManhole = self.openManhole 63 AdminAvatar.perspective_closeManhole = self.closeManhole6466 if not self.port: 67 if self.useSSH: 68 self.port = openSSHManhole(self.authorizedKeysFile, 69 self.namespace, 70 self.requestedPortNum) 71 else: 72 self.port = openAnonymousTelnetManhole(self.namespace, 73 self.requestedPortNum) 74 75 return self.port.getHost().port76
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Aug 13 06:17:31 2013 | http://epydoc.sourceforge.net |