Added support for mount namespaces in bind.py. Also moved it to the node class as a host type.

This commit is contained in:
Cody Burkard
2014-06-10 11:44:03 -07:00
parent 87b6021428
commit 9109233886
2 changed files with 20 additions and 161 deletions
+17
View File
@@ -725,6 +725,23 @@ class CPULimitedHost( Host ):
mountCgroups()
cls.inited = True
class HostWithPrivateDirs( Host ):
"Host with private directories"
def __init__(self, *args, **kwargs ):
"""privateDirs: list of private directories"""
self.privateDirs = kwargs.pop( 'privateDirs', [] )
Host.__init__( self, *args, **kwargs )
self.mountPrivateDirs()
def mountPrivateDirs( self ):
"Mount tmpfs for each private directory"
for dir_ in self.privateDirs:
self.cmd( 'mkdir -p ' + dir_ )
self.cmd( 'mount -n -t tmpfs tmpfs %s' % dir_ )
# Some important things to note:
#