Skip to content

Commit e698ef4

Browse files
Remove code that was moved to anothery PR
1 parent f899818 commit e698ef4

File tree

9 files changed

+20
-39
lines changed

9 files changed

+20
-39
lines changed

cmapi/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ Packages have bundled python interpreter and python dependencies.
3737
## Get dependencies
3838

3939
# get portable python
40-
wget -qO- https://github.com/indygreg/python-build-standalone/releases/download/20220802/cpython-3.9.13+20220802-x86_64_v2-unknown-linux-gnu-pgo+lto-full.tar.zst | tar --zstd -xvf - -C ./
40+
wget -qO- https://cspkg.s3.amazonaws.com/python-dist-no-nis.tar.gz | tar xzf - -C ./
4141

4242
# install python dependencies
43-
python/install/bin/pip3 install -t deps --only-binary :all -r requirements.txt
43+
python/bin/pip3 install -t deps --only-binary :all -r requirements.txt
4444

4545
## RPM
4646

4747
```sh
4848
./cleanup.sh
4949
yum install -y wget cmake make rpm-build
50-
cmake -DRPM=1 -DSERVER_DIR=<path to server repo root> .
50+
cmake -DRPM=1 .
5151
make package
5252
```
5353

@@ -56,6 +56,6 @@ make package
5656
```sh
5757
./cleanup.sh
5858
DEBIAN_FRONTEND=noninteractive apt update && apt install -y cmake make
59-
cmake -DDEB=1 -DSERVER_DIR=<path to server repo root> .
59+
cmake -DDEB=1 .
6060
make package
6161
```

cmapi/cmapi_server/constants.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ class ProgInfo(NamedTuple):
7878
ALL_MCS_PROGS: dict[str, ProgInfo] = {
7979
# workernode starts on primary and non primary node with 1 or 2 added
8080
# to subcommand (DBRM_Worker1 - on primary, DBRM_Worker2 - non primary)
81-
MCSProgs.STORAGE_MANAGER.name: ProgInfo(15, 'mcs-storagemanager', '', False, 1),
82-
MCSProgs.WORKER_NODE.name: ProgInfo(13, 'mcs-workernode', 'DBRM_Worker{}', False, 1),
83-
MCSProgs.CONTROLLER_NODE.name: ProgInfo(11, 'mcs-controllernode', 'fg', True),
84-
MCSProgs.PRIM_PROC.name: ProgInfo(5, 'mcs-primproc', '', False, 1),
85-
MCSProgs.EXE_MGR.name: ProgInfo(9, 'mcs-exemgr', '', False, 1),
86-
MCSProgs.WRITE_ENGINE_SERVER.name: ProgInfo(7, 'mcs-writeengineserver', '', False, 3),
87-
MCSProgs.DML_PROC.name: ProgInfo(3, 'mcs-dmlproc', '', False),
88-
MCSProgs.DDL_PROC.name: ProgInfo(1, 'mcs-ddlproc', '', False),
81+
MCSProgs.STORAGE_MANAGER.value: ProgInfo(15, 'mcs-storagemanager', '', False, 1),
82+
MCSProgs.WORKER_NODE.value: ProgInfo(13, 'mcs-workernode', 'DBRM_Worker{}', False, 1),
83+
MCSProgs.CONTROLLER_NODE.value: ProgInfo(11, 'mcs-controllernode', 'fg', True),
84+
MCSProgs.PRIM_PROC.value: ProgInfo(5, 'mcs-primproc', '', False, 1),
85+
MCSProgs.EXE_MGR.value: ProgInfo(9, 'mcs-exemgr', '', False, 1),
86+
MCSProgs.WRITE_ENGINE_SERVER.value: ProgInfo(7, 'mcs-writeengineserver', '', False, 3),
87+
MCSProgs.DML_PROC.value: ProgInfo(3, 'mcs-dmlproc', '', False),
88+
MCSProgs.DDL_PROC.value: ProgInfo(1, 'mcs-ddlproc', '', False),
8989
}
9090

9191
# constants for docker container dispatcher

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.info('Cluster add node command called. Adding node %s in %s mode.', node, 'read-only' if read_only else 'read-write')
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/helpers.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,6 @@ async def update_config(node, success_nodes, failed_nodes, headers, body):
372372
logging.warning(
373373
f'Timeout while pushing new config to "{node}"'
374374
)
375-
except requests.exceptions.RequestException as e:
376-
logging.warning(
377-
'Error while pushing new config to "%s": %s"', node, str(e)
378-
)
379-
logging.debug('Response: %s', r.text)
380375
except Exception as e:
381376
logging.warning(
382377
f'Got an unexpected error pushing new config to "{node}"',

cmapi/cmapi_server/managers/process.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,19 +419,19 @@ def start_node(cls, is_primary: bool, use_sudo: bool = True, is_read_only: bool
419419
for prog_name in cls._get_sorted_progs(is_primary):
420420
if (
421421
cls.dispatcher_name == 'systemd'
422-
and prog_name == MCSProgs.STORAGE_MANAGER.name
422+
and prog_name == MCSProgs.STORAGE_MANAGER.value
423423
):
424424
# TODO: MCOL-5458
425425
logging.info(
426426
f'Skip starting {prog_name} with systemd dispatcher.'
427427
)
428428
continue
429429
# TODO: additional error handling
430-
if prog_name == MCSProgs.CONTROLLER_NODE.name:
430+
if prog_name == MCSProgs.CONTROLLER_NODE.value:
431431
cls._wait_for_workernodes()
432-
if prog_name in (MCSProgs.DML_PROC.name, MCSProgs.DDL_PROC.name):
432+
if prog_name in (MCSProgs.DML_PROC.value, MCSProgs.DDL_PROC.value):
433433
cls._wait_for_controllernode()
434-
if is_read_only and prog_name == MCSProgs.WRITE_ENGINE_SERVER.name:
434+
if is_read_only and prog_name == MCSProgs.WRITE_ENGINE_SERVER.value:
435435
logging.debug('Node is in read-only mode, not starting WriteEngine')
436436
continue
437437
if not cls.start(prog_name, is_primary, use_sudo):

cmapi/cmapi_server/node_manipulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def switch_node_maintenance(
5555
maintenance_element = etree.SubElement(config_root, 'Maintenance')
5656
maintenance_element.text = str(maintenance_state).lower()
5757
node_config.write_config(config_root, filename=output_config_filename)
58-
# TODO: probably move publishing to cherrypy.engine failover channel here?
58+
# TODO: probably move publishing to cherrypy.emgine failover channel here?
5959

6060

6161
def add_node(

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 for command to finish.')
82+
logging.debug('Waiting 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 if "{service}" is running.')
67+
logging.debug(f'Checking "{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

cmapi/mcs_cluster_tool/__main__.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,6 @@ def help_all():
3838
# Open the man page in interactive mode
3939
subprocess.run(['man', 'mcs'])
4040

41-
@app.callback()
42-
def main(verbose: bool = typer.Option(False, "--verbose", "-v", help="Enable verbose logging to console")):
43-
"""Add a -v option and setup logging in every subcommand"""
44-
setup_logging(verbose)
45-
46-
47-
def setup_logging(verbose: bool = False) -> None:
48-
add_logging_level('TRACE', 5)
49-
dict_config(MCS_CLI_LOG_CONF_PATH)
50-
51-
if verbose:
52-
enable_console_logging(logging.getLogger())
53-
enable_console_logging(logging.getLogger('mcs_cli'))
54-
5541

5642
if __name__ == '__main__':
5743
add_logging_level('TRACE', 5) #TODO: remove when stadalone mode added.

0 commit comments

Comments
 (0)