Commit df99f3a9 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

pathutils: Add directory for remote commands



Also add tests to ensure it's never allowed as a file storage path. A
constant for the lock file is also added.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 2f18052f
......@@ -88,6 +88,10 @@ USER_SCRIPTS_DIR = CONF_DIR + "/scripts"
VNC_PASSWORD_FILE = CONF_DIR + "/vnc-cluster-password"
HOOKS_BASE_DIR = CONF_DIR + "/hooks"
FILE_STORAGE_PATHS_FILE = CONF_DIR + "/file-storage-paths"
REMOTE_COMMANDS_DIR = CONF_DIR + "/remote-commands"
#: Locked in exclusive mode while noded verifies a remote command
REMOTE_COMMANDS_LOCK_FILE = LOCK_DIR + "/ganeti-remote-commands.lock"
#: Lock file for watcher, locked in shared mode by watcher; lock in exclusive
# mode to block watcher (see L{cli._RunWhileClusterStoppedHelper.Call}
......
#!/usr/bin/python
#
# Copyright (C) 2006, 2007, 2010 Google Inc.
# Copyright (C) 2006, 2007, 2010, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -29,6 +29,7 @@ from ganeti import bdev
from ganeti import errors
from ganeti import constants
from ganeti import utils
from ganeti import pathutils
import testutils
......@@ -391,6 +392,10 @@ class TestComputeWrongFileStoragePathsInternal(unittest.TestCase):
self.assertEqual(vfsp(["/usr/sbin/vim", "/srv/file-storage"]),
["/usr/sbin/vim"])
self.assertTrue(vfsp([pathutils.REMOTE_COMMANDS_DIR]),
msg=("Remote commands directory should never be valid"
"for file storage"))
class TestComputeWrongFileStoragePaths(testutils.GanetiTestCase):
def test(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment