Skip to content

Commit

Permalink
control/cli: add ip requirement for listener
Browse files Browse the repository at this point in the history
discovert controller need a specific ip/port.

fixes: #87

Signed-off-by: Yin Congmin <[email protected]>
  • Loading branch information
CongMinYin committed May 10, 2023
1 parent 8cc5229 commit 3e9effb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions control/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import grpc
import json
import logging
import socket
from .generated import gateway_pb2_grpc as pb2_grpc
from .generated import gateway_pb2 as pb2
from .config import GatewayConfig
Expand Down Expand Up @@ -268,10 +269,10 @@ def remove_host(self, args):

@cli.cmd([
argument("-n", "--subnqn", help="Subsystem NQN", required=True),
argument("-g", "--gateway-name", help="Gateway name", default=""),
argument("-g", "--gateway-name", help="Gateway name", default=socket.gethostname()),
argument("-t", "--trtype", help="Transport type", default="TCP"),
argument("-f", "--adrfam", help="Address family", default="ipv4"),
argument("-a", "--traddr", help="NVMe host IP", default=""),
argument("-a", "--traddr", help="NVMe host IP", required=True),
argument("-s", "--trsvcid", help="Port number", required=True),
])
def create_listener(self, args):
Expand All @@ -293,10 +294,10 @@ def create_listener(self, args):

@cli.cmd([
argument("-n", "--subnqn", help="Subsystem NQN", required=True),
argument("-g", "--gateway-name", help="Gateway name", default=""),
argument("-g", "--gateway-name", help="Gateway name", default=socket.gethostname()),
argument("-t", "--trtype", help="Transport type", default="TCP"),
argument("-f", "--adrfam", help="Address family", default="ipv4"),
argument("-a", "--traddr", help="NVMe host IP", default=""),
argument("-a", "--traddr", help="NVMe host IP", required=True),
argument("-s", "--trsvcid", help="Port number", required=True),
])
def delete_listener(self, args):
Expand Down

0 comments on commit 3e9effb

Please sign in to comment.