diff --git a/lib/vcluster.py b/lib/vcluster.py index ed28cab1772fae4da1a37c4c590ba9005fe831ec..407c352e9b90310ffd0806a0236e1b0258471997 100644 --- a/lib/vcluster.py +++ b/lib/vcluster.py @@ -142,7 +142,7 @@ def GetVirtualHostname(): return _VIRT_HOSTNAME -def _MakeNodeRoot(base, node_name): +def MakeNodeRoot(base, node_name): """Appends a node name to the base directory. """ @@ -162,7 +162,7 @@ def ExchangeNodeRoot(node_name, filename, """ if _basedir: pure = _RemoveNodePrefix(filename, _noderoot=_noderoot) - result = "%s/%s" % (_MakeNodeRoot(_basedir, node_name), pure) + result = "%s/%s" % (MakeNodeRoot(_basedir, node_name), pure) else: result = filename @@ -175,7 +175,7 @@ def EnvironmentForHost(hostname, _basedir=_VIRT_BASEDIR): """ if _basedir: return { - _ROOTDIR_ENVNAME: _MakeNodeRoot(_basedir, hostname), + _ROOTDIR_ENVNAME: MakeNodeRoot(_basedir, hostname), _HOSTNAME_ENVNAME: hostname, } else: diff --git a/test/py/ganeti.vcluster_unittest.py b/test/py/ganeti.vcluster_unittest.py index e47b1f8866fe8bf0bc2c8b377d18df1a3b8342fb..0f216da4e2878981c6591da9d2bc8a53af2bc47c 100755 --- a/test/py/ganeti.vcluster_unittest.py +++ b/test/py/ganeti.vcluster_unittest.py @@ -108,10 +108,10 @@ class TestPreparePaths(_EnvVarTest): class TestMakeNodeRoot(unittest.TestCase): def test(self): - self.assertRaises(RuntimeError, vcluster._MakeNodeRoot, "/tmp", "/") + self.assertRaises(RuntimeError, vcluster.MakeNodeRoot, "/tmp", "/") for i in ["/tmp", "/tmp/", "/tmp///"]: - self.assertEqual(vcluster._MakeNodeRoot(i, "other.example.com"), + self.assertEqual(vcluster.MakeNodeRoot(i, "other.example.com"), "/tmp/other.example.com")