def _default_config_hook(self): """The default export block. Subclass this to add FSAL specific defaults. Suggested approach: take the return value of superclass' method, patch with dict containing your defaults, and return the result. However, you can also provide your defaults from scratch with no regard to superclass. """ return self._load_conf_dir(ganesha_utils.path_from(__file__, "conf"))
def _default_config_hook(self): """The default export block. Subclass this to add FSAL specific defaults. Suggested approach: take the return value of superclass' method, patch with dict containing your defaults, and return the result. However, you can also provide your defaults from scratch with no regard to superclass. """ return self._load_conf_dir(ganesha_utils.path_from(__file__, "conf"))
def _default_config_hook(self): """Callback to provide default export block.""" dconf = super(GaneshaNFSHelper, self)._default_config_hook() conf_dir = ganesha_utils.path_from(__file__, "conf") ganesha_utils.patch(dconf, self._load_conf_dir(conf_dir)) return dconf
def test_path_from(self): self.mock_object(os.path, 'abspath', lambda path: os.path.join('/foo/bar', path)) ret = ganesha_utils.path_from('baz.py', '../quux', 'tic/tac/toe') self.assertEqual('/foo/quux/tic/tac/toe', os.path.normpath(ret))