From 81f0b6984fcfd90b470052b9de19b8b10d176972 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 6 May 2021 18:47:27 -0400 Subject: [PATCH] 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 --- src/pybind/mgr/nfs/module.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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) -- 2.39.5