self._cmd(*export_cmd)
# Check if user id for export is created
self._check_auth_ls(export_id, check_in=True)
- res = self._sys_cmd(['rados', '-p', 'nfs-ganesha', '-N', self.cluster_id, 'get',
+ res = self._sys_cmd(['rados', '-p', '.nfs', '-N', self.cluster_id, 'get',
f'export-{export_id}', '-'])
# Check if export object is created
if res == b'':
Test if export or config object are deleted successfully.
:param conf_obj: It denotes config object needs to be checked
'''
- rados_obj_ls = self._sys_cmd(['rados', '-p', 'nfs-ganesha', '-N', self.cluster_id, 'ls'])
+ rados_obj_ls = self._sys_cmd(['rados', '-p', '.nfs', '-N', self.cluster_id, 'ls'])
if b'export-' in rados_obj_ls or (conf_obj and b'conf-nfs' in rados_obj_ls):
self.fail("Delete export failed")
'''
self._test_create_cluster()
- pool = 'nfs-ganesha'
+ pool = '.nfs'
user_id = 'test'
fs_name = 'user_test_fs'
pseudo_path = '/ceph'
self.assertEqual(config, res.decode('utf-8'))
self._test_mnt(pseudo_path, port, ip)
self._nfs_cmd('cluster', 'config', 'reset', self.cluster_id)
- rados_obj_ls = self._sys_cmd(['rados', '-p', 'nfs-ganesha', '-N', self.cluster_id, 'ls'])
+ rados_obj_ls = self._sys_cmd(['rados', '-p', '.nfs', '-N', self.cluster_id, 'ls'])
if b'conf-nfs' not in rados_obj_ls and b'userconf-nfs' in rados_obj_ls:
self.fail("User config not deleted")
time.sleep(30)
from typing import Dict, Tuple, Any, List, cast, Optional
from mgr_module import HandleCommandResult
+from mgr_module import NFS_POOL_NAME as POOL_NAME
from ceph.deployment.service_spec import ServiceSpec, NFSServiceSpec
from cephadm.services.cephadmservice import AuthEntity, CephadmDaemonDeploySpec, CephService
-
-POOL_NAME = 'nfs-ganesha' # make sure this matches pybind/mgr/nfs/nfs_utils.py
-
logger = logging.getLogger(__name__)
"wait",
]
+NFS_POOL_NAME = '.nfs'
+
class CommandResult(object):
"""
import socket
from typing import cast, Dict, List, Any, Union, Optional, TYPE_CHECKING, Tuple
+from mgr_module import NFS_POOL_NAME as POOL_NAME
from ceph.deployment.service_spec import NFSServiceSpec, PlacementSpec, IngressSpec
import orchestrator
from .exception import NFSInvalidOperation, ClusterNotFound
-from .utils import POOL_NAME, available_clusters, restart_nfs_service
+from .utils import available_clusters, restart_nfs_service
from .export import NFSRados, exception_handler
if TYPE_CHECKING:
from rados import TimedOut, ObjectNotFound
+from mgr_module import NFS_POOL_NAME as POOL_NAME
+
from .export_utils import GaneshaConfParser, Export, RawBlock, CephFSFSAL, RGWFSAL
from .exception import NFSException, NFSInvalidOperation, FSNotFound, \
ClusterNotFound
-from .utils import POOL_NAME, available_clusters, check_fs, restart_nfs_service
+from .utils import available_clusters, check_fs, restart_nfs_service
if TYPE_CHECKING:
from nfs.module import Module
conf_nodeb = '%url "rados://ganesha/ns/export-1"'
conf_nfs_foo = '''
-%url "rados://nfs-ganesha/foo/export-1"
+%url "rados://.nfs/foo/export-1"
-%url "rados://nfs-ganesha/foo/export-2"'''
+%url "rados://.nfs/foo/export-2"'''
clusters = {
'foo': {
- 'pool': 'nfs-ganesha',
+ 'pool': '.nfs',
'namespace': 'foo',
'type': "ORCHESTRATOR",
'daemon_conf': 'conf-nfs.foo',
# mock nfs services
cluster_info = self.clusters['foo']
orch_nfs_services = [
- ServiceDescription(spec=NFSServiceSpec(service_id='foo',
- pool=cluster_info['pool'],
- namespace=cluster_info['namespace']))
+ ServiceDescription(spec=NFSServiceSpec(service_id='foo'))
] if enable else []
"""
"minor_versions": [1, 2]
}),
RawBlock('RADOS_KV', values={
- "pool": "nfs-ganesha",
+ "pool": ".nfs",
"namespace": "vstart",
"userid": "vstart",
"nodeid": "a"
}),
RawBlock('RADOS_URLS', values={
"userid": "vstart",
- "watch_url": "'rados://nfs-ganesha/vstart/conf-nfs.vstart'"
+ "watch_url": "'rados://.nfs/vstart/conf-nfs.vstart'"
}),
RawBlock('%url', values={
- "value": "rados://nfs-ganesha/vstart/conf-nfs.vstart"
+ "value": "rados://.nfs/vstart/conf-nfs.vstart"
})
]
daemon_raw_config = """
}
RADOS_KV {
- pool = nfs-ganesha;
+ pool = .nfs;
namespace = vstart;
UserId = vstart;
nodeid = a;
RADOS_URLS {
Userid = vstart;
- watch_url = 'rados://nfs-ganesha/vstart/conf-nfs.vstart';
+ watch_url = 'rados://.nfs/vstart/conf-nfs.vstart';
}
- %url rados://nfs-ganesha/vstart/conf-nfs.vstart
+ %url rados://.nfs/vstart/conf-nfs.vstart
"""
daemon_config = GaneshaConfParser(daemon_raw_config).parse()
assert daemon_config == expected_daemon_config
if TYPE_CHECKING:
from nfs.module import Module
-POOL_NAME = 'nfs-ganesha'
-
def available_clusters(mgr: 'Module') -> List[str]:
'''
from ceph.deployment.drive_group import DriveGroupSpec
from ceph.deployment.service_spec import ServiceSpec, NFSServiceSpec, RGWSpec
from ceph.utils import datetime_now
+from mgr_module import NFS_POOL_NAME
from mgr_util import merge_dicts
from typing import Optional, TypeVar, List, Callable, Any, cast, Generic, \
from .rook_client.ceph import cephcluster as ccl
from .rook_client._helper import CrdClass
-
import orchestrator
-
try:
from rook.module import RookEnv
except ImportError:
pass # just used for type checking.
-POOL_NAME = 'nfs-ganesha' # keep in sync with mgr/nfs/nfs_utils.py
-
T = TypeVar('T')
FuncT = TypeVar('FuncT', bound=Callable)
spec=cnfs.Spec(
rados=cnfs.Rados(
namespace=self.rook_env.namespace,
- pool=POOL_NAME,
+ pool=NFS_POOL_NAME,
),
server=cnfs.Server(
active=count
class NFSServiceSpec(ServiceSpec):
- DEFAULT_POOL = 'nfs-ganesha'
+ DEFAULT_POOL = '.nfs'
def __init__(self,
service_type: str = 'nfs',