daemon: Improve handling node-specific directory names.
This commit is contained in:
parent
a83cf2fcb4
commit
ce0bfc88eb
3 changed files with 6 additions and 3 deletions
|
@ -361,7 +361,8 @@ class JailNode(SimpleJailNode):
|
|||
def privatedir(self, path):
|
||||
if path[0] != "/":
|
||||
raise ValueError, "path not fully qualified: " + path
|
||||
hostpath = os.path.join(self.nodedir, path[1:].replace("/", "."))
|
||||
hostpath = os.path.join(self.nodedir,
|
||||
os.path.normpath(path).strip('/').replace('/', '.'))
|
||||
try:
|
||||
os.mkdir(hostpath)
|
||||
except OSError:
|
||||
|
|
|
@ -366,7 +366,8 @@ class LxcNode(SimpleLxcNode):
|
|||
def privatedir(self, path):
|
||||
if path[0] != "/":
|
||||
raise ValueError, "path not fully qualified: " + path
|
||||
hostpath = os.path.join(self.nodedir, path[1:].replace("/", "."))
|
||||
hostpath = os.path.join(self.nodedir,
|
||||
os.path.normpath(path).strip('/').replace('/', '.'))
|
||||
try:
|
||||
os.mkdir(hostpath)
|
||||
except OSError:
|
||||
|
|
|
@ -216,7 +216,8 @@ class PhysicalNode(PyCoreNode):
|
|||
def privatedir(self, path):
|
||||
if path[0] != "/":
|
||||
raise ValueError, "path not fully qualified: " + path
|
||||
hostpath = os.path.join(self.nodedir, path[1:].replace("/", "."))
|
||||
hostpath = os.path.join(self.nodedir,
|
||||
os.path.normpath(path).strip('/').replace('/', '.'))
|
||||
try:
|
||||
os.mkdir(hostpath)
|
||||
except OSError:
|
||||
|
|
Loading…
Reference in a new issue