Skip to content

Commit bbd12b4

Browse files
More logging
1 parent 6b4f34e commit bbd12b4

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

cmapi/cmapi_server/handlers/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def add_node(
219219
:return: result of adding node
220220
:rtype: dict
221221
"""
222-
logger.debug(f'Cluster add node command called. Adding node {node}.')
222+
logger.debug('Cluster add node command called. Adding node %s in %s mode.', node, 'read-only' if read_only else 'read-write')
223223

224224
response = {'timestamp': str(datetime.now())}
225225
transaction_id = get_id()

cmapi/cmapi_server/node_manipulation.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,19 @@ def add_node(
100100
if not read_only:
101101
_add_WES(c_root, pm_num, node)
102102
else:
103+
logging.debug("Node is read-only, skipping WES addition")
103104
_add_read_only_node(c_root, node)
104105

105106
_add_DBRM_Worker(c_root, node)
106107
_add_Module_entries(c_root, node)
107108
_add_active_node(c_root, node)
108109
_add_node_to_ExeMgrs(c_root, node)
109-
if rebalance_dbroots and not read_only:
110-
_rebalance_dbroots(c_root)
111-
_move_primary_node(c_root)
110+
if rebalance_dbroots:
111+
if not read_only:
112+
_rebalance_dbroots(c_root)
113+
_move_primary_node(c_root)
114+
else:
115+
logging.debug("Node is read-only, skipping dbroots rebalancing")
112116
except Exception:
113117
logging.error(
114118
'Caught exception while adding node, config file is unchanged',

cmapi/cmapi_server/process_dispatchers/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def exec_command(
7979
del proc
8080
result = (True, output)
8181
else:
82-
logging.debug('Waiting command to finish.')
82+
logging.debug('Waiting for command to finish.')
8383
stdout_str, _ = proc.communicate()
8484
returncode = proc.wait()
8585
if stdout_str is not None:

cmapi/cmapi_server/process_dispatchers/systemd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def is_service_running(cls, service: str, use_sudo: bool = True) -> bool:
6464
..Note:
6565
Not working with multiple services at a time.
6666
"""
67-
logging.debug(f'Checking "{service}" is running.')
67+
logging.debug(f'Checking if "{service}" is running.')
6868
# TODO: remove conditions below when we'll drop CentOS 7 support
6969
cmd = 'show -p ActiveState --value'
7070
if cls.systemctl_version < 230: # not supported --value in old version

0 commit comments

Comments
 (0)