Skip to content

Commit

Permalink
Add nvmeof version and config file path to the log messages.
Browse files Browse the repository at this point in the history
Fixes ceph#244

Signed-off-by: Gil Bregman <[email protected]>
  • Loading branch information
gbregman committed Oct 9, 2023
1 parent ee92f6c commit 0d3728c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ ARG NVMEOF_NAME \
NVMEOF_GIT_BRANCH \
NVMEOF_GIT_COMMIT

ENV NVMEOF_VERSION="${NVMEOF_VERSION}"

# Generic labels
LABEL name="$NVMEOF_NAME" \
version="$NVMEOF_VERSION" \
Expand Down
2 changes: 1 addition & 1 deletion ceph-nvmeof.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ state_update_notify = True
state_update_interval_sec = 5
#min_controller_id = 1
#max_controller_id = 65519
enable_spdk_discovery_controller = false
enable_spdk_discovery_controller = False

[discovery]
addr = 0.0.0.0
Expand Down
1 change: 1 addition & 0 deletions control/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class GatewayConfig:
config: Config parser object
"""
def __init__(self, conffile):
self.filepath = conffile
with open(conffile) as f:
self.config = configparser.ConfigParser()
self.config.read_file(f)
Expand Down
5 changes: 5 additions & 0 deletions control/grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import uuid
import random
import logging
import os

import spdk.rpc.bdev as rpc_bdev
import spdk.rpc.nvmf as rpc_nvmf
Expand All @@ -38,7 +39,11 @@ class GatewayService(pb2_grpc.GatewayServicer):
def __init__(self, config, gateway_state, spdk_rpc_client) -> None:
"""Constructor"""
self.logger = logging.getLogger(__name__)
ver = os.getenv("NVMEOF_VERSION")
if ver:
self.logger.info(f"Using NVMeoF gateway version {ver}")
self.config = config
self.logger.info(f"Using configuration file {config.filepath}")
self.gateway_state = gateway_state
self.spdk_rpc_client = spdk_rpc_client
self.gateway_name = self.config.get("gateway", "name")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_multi_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def conn(config):
configA.config["gateway"]["state_update_notify"] = str(update_notify)
configA.config["gateway"]["min_controller_id"] = "1"
configA.config["gateway"]["max_controller_id"] = "20000"
configA.config["gateway"]["enable_spdk_discovery_controller"] = "true"
configA.config["gateway"]["enable_spdk_discovery_controller"] = "True"
configB = copy.deepcopy(configA)
addr = configA.get("gateway", "addr")
portA = configA.getint("gateway", "port")
Expand Down

0 comments on commit 0d3728c

Please sign in to comment.