]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/services/iscsi_cli.py
import ceph 15.2.10
[ceph.git] / ceph / src / pybind / mgr / dashboard / services / iscsi_cli.py
index e894a56caef73465f775dbbf6c69a40490440da2..a290337c10c2490b0c376f4ca725fa4e0476697e 100644 (file)
@@ -4,7 +4,7 @@ from __future__ import absolute_import
 import errno
 import json
 
-from mgr_module import CLIReadCommand, CLIWriteCommand
+from mgr_module import CLICheckNonemptyFileInput, CLIReadCommand, CLIWriteCommand
 
 from .iscsi_client import IscsiClient
 from .iscsi_config import IscsiGatewaysConfig, IscsiGatewayAlreadyExists, InvalidServiceUrl, \
@@ -18,10 +18,11 @@ def list_iscsi_gateways(_):
 
 
 @CLIWriteCommand('dashboard iscsi-gateway-add',
-                 'name=service_url,type=CephString '
                  'name=name,type=CephString,req=false',
-                 'Add iSCSI gateway configuration')
-def add_iscsi_gateway(_, service_url, name=None):
+                 'Add iSCSI gateway configuration. Gateway URL read from -i <file>')
+@CLICheckNonemptyFileInput
+def add_iscsi_gateway(_, inbuf, name=None):
+    service_url = inbuf
     try:
         IscsiGatewaysConfig.validate_service_url(service_url)
         if name is None: