return path
@export_cluster_checker
- def create_export(self, **kwargs: Any) -> Tuple[int, str, str]:
+ def create_export(self, addr: Optional[List[str]] = None, **kwargs: Any) -> Tuple[int, str, str]:
+ # if addr(s) are provided, construct client list and adjust outer block
+ clients = []
+ if addr:
+ clients = [{
+ 'addresses': addr,
+ 'access_type': 'ro' if kwargs['read_only'] else 'rw',
+ 'squash': kwargs['squash'],
+ }]
+ kwargs['squash'] = 'none'
+ kwargs['clients'] = clients
+
try:
fsal_type = kwargs.pop('fsal_type')
if fsal_type == 'cephfs':
squash: str = 'none',
) -> Tuple[int, str, str]:
"""Create a cephfs export"""
- clients = []
- if addr:
- clients = [{
- 'addresses': addr,
- 'access_type': 'ro' if readonly else 'rw',
- 'squash': squash,
- }]
- squash = 'none'
return self.export_mgr.create_export(fsal_type='cephfs', fs_name=fsname,
cluster_id=cluster_id, pseudo_path=binding,
read_only=readonly, path=path,
- squash=squash, clients=clients)
+ squash=squash, addr=addr)
@CLICommand('nfs export create rgw', perm='rw')
def _cmd_rgw_export_create_cephfs(
realm: Optional[str] = None,
) -> Tuple[int, str, str]:
"""Create an RGW export"""
- clients = []
- squash = 'none'
- if addr:
- clients = [{
- 'addresses': addr,
- 'access_type': 'ro' if readonly else 'rw',
- 'squash': squash,
- }]
- squash = 'none'
return self.export_mgr.create_export(fsal_type='rgw', bucket=bucket,
realm=realm,
cluster_id=cluster_id, pseudo_path=binding,
- read_only=readonly, squash=squash,
- clients=clients)
+ read_only=readonly, squash='none',
+ addr=addr)
@CLICommand('nfs export import', perm='rw')
def _cmd_nfs_export_import(self,