Skip to content

Commit 3388962

Browse files
authored
Merge pull request ceph#256 from gbregman/devel
Add nvmeof version and config file path to the log messages.
2 parents ee92f6c + 4d61341 commit 3388962

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ ARG NVMEOF_NAME \
5454
NVMEOF_GIT_BRANCH \
5555
NVMEOF_GIT_COMMIT
5656

57+
ENV NVMEOF_VERSION="${NVMEOF_VERSION}"
58+
5759
# Generic labels
5860
LABEL name="$NVMEOF_NAME" \
5961
version="$NVMEOF_VERSION" \

ceph-nvmeof.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ state_update_notify = True
1717
state_update_interval_sec = 5
1818
#min_controller_id = 1
1919
#max_controller_id = 65519
20-
enable_spdk_discovery_controller = false
20+
enable_spdk_discovery_controller = False
2121

2222
[discovery]
2323
addr = 0.0.0.0

control/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class GatewayConfig:
1717
config: Config parser object
1818
"""
1919
def __init__(self, conffile):
20+
self.filepath = conffile
2021
with open(conffile) as f:
2122
self.config = configparser.ConfigParser()
2223
self.config.read_file(f)

control/grpc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import uuid
1414
import random
1515
import logging
16+
import os
1617

1718
import spdk.rpc.bdev as rpc_bdev
1819
import spdk.rpc.nvmf as rpc_nvmf
@@ -38,7 +39,11 @@ class GatewayService(pb2_grpc.GatewayServicer):
3839
def __init__(self, config, gateway_state, spdk_rpc_client) -> None:
3940
"""Constructor"""
4041
self.logger = logging.getLogger(__name__)
42+
ver = os.getenv("NVMEOF_VERSION")
43+
if ver:
44+
self.logger.info(f"Using NVMeoF gateway version {ver}")
4145
self.config = config
46+
self.logger.info(f"Using configuration file {config.filepath}")
4247
self.gateway_state = gateway_state
4348
self.spdk_rpc_client = spdk_rpc_client
4449
self.gateway_name = self.config.get("gateway", "name")

tests/test_multi_gateway.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def conn(config):
2020
configA.config["gateway"]["state_update_notify"] = str(update_notify)
2121
configA.config["gateway"]["min_controller_id"] = "1"
2222
configA.config["gateway"]["max_controller_id"] = "20000"
23-
configA.config["gateway"]["enable_spdk_discovery_controller"] = "true"
23+
configA.config["gateway"]["enable_spdk_discovery_controller"] = "True"
2424
configB = copy.deepcopy(configA)
2525
addr = configA.get("gateway", "addr")
2626
portA = configA.getint("gateway", "port")

0 commit comments

Comments
 (0)