mirror of
https://github.com/ceph/ceph
synced 2025-02-24 19:47:44 +00:00
volumes/fs/nfs: Don't parse rados export objects during FSExport init
Instead we can do it if any export commands are used. This fixes ImportError raised when FSExport is initialized with cephadm module disabled. Signed-off-by: Varsha Rao <varao@redhat.com>
This commit is contained in:
parent
4da7581675
commit
4ebb2581d6
@ -374,19 +374,7 @@ class FSExport(object):
|
||||
self.mgr = mgr
|
||||
self.rados_pool = 'nfs-ganesha'
|
||||
self.rados_namespace = namespace
|
||||
self.exports = {}
|
||||
|
||||
try:
|
||||
log.info("Begin export parsing")
|
||||
for cluster_id in available_clusters(self.mgr):
|
||||
self.export_conf_objs = [] # type: List[Export]
|
||||
self._read_raw_config(cluster_id)
|
||||
self.exports[cluster_id] = self.export_conf_objs
|
||||
log.info(f"Exports parsed successfully {self.exports.items()}")
|
||||
except orchestrator.NoOrchestrator:
|
||||
# Pass it for vstart
|
||||
log.info("Orchestrator not found")
|
||||
pass
|
||||
self._exports = None
|
||||
|
||||
@staticmethod
|
||||
def _check_rados_notify(ioctx, obj):
|
||||
@ -395,6 +383,18 @@ class FSExport(object):
|
||||
except TimedOut:
|
||||
log.exception(f"Ganesha timed out")
|
||||
|
||||
@property
|
||||
def exports(self):
|
||||
if self._exports is None:
|
||||
self._exports = {}
|
||||
log.info("Begin export parsing")
|
||||
for cluster_id in available_clusters(self.mgr):
|
||||
self.export_conf_objs = [] # type: List[Export]
|
||||
self._read_raw_config(cluster_id)
|
||||
self.exports[cluster_id] = self.export_conf_objs
|
||||
log.info(f"Exports parsed successfully {self.exports.items()}")
|
||||
return self._exports
|
||||
|
||||
def _fetch_export(self, pseudo_path):
|
||||
try:
|
||||
for ex in self.exports[self.rados_namespace]:
|
||||
|
Loading…
Reference in New Issue
Block a user