From: Sage Weil Date: Thu, 6 May 2021 22:47:27 +0000 (-0400) Subject: mgr/nfs: take --ingress argument to 'nfs cluster create' X-Git-Tag: v17.1.0~1854^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=81f0b6984fcfd90b470052b9de19b8b10d176972;p=ceph.git mgr/nfs: take --ingress argument to 'nfs cluster create' It is likely that the rook/k8s variation of ingress will not take a virtual_ip argument. We want to make sure that ingress yes/no can be specified independent of the virtual_ip. Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/nfs/module.py b/src/pybind/mgr/nfs/module.py index 8d26f07e1935e..164c9f133aa22 100644 --- a/src/pybind/mgr/nfs/module.py +++ b/src/pybind/mgr/nfs/module.py @@ -1,3 +1,4 @@ +import errno import logging import threading from typing import Tuple, Optional, List @@ -66,8 +67,15 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule): def _cmd_nfs_cluster_create(self, clusterid: str, placement: Optional[str]=None, + ingress: Optional[bool]=None, virtual_ip: Optional[str]=None) -> Tuple[int, str, str]: """Create an NFS Cluster""" + if virtual_ip and not ingress: + return (-errno.EINVAL, '', + '--virtual-ip can only be provided with --ingress') + if ingress and not virtual_ip: + return (-errno.EINVAL, '', + '--ingress current requires --virtual-ip') return self.nfs.create_nfs_cluster(cluster_id=clusterid, placement=placement, virtual_ip=virtual_ip)