Skip to content

Commit

Permalink
Small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
badrogger committed Dec 23, 2024
1 parent 1ceae64 commit fbc27e7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion node_cli/core/nftables.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from collections import namedtuple # hotfix for tests
iptc = namedtuple('nftables', ['Chain', 'Rule'])
else:
logger.error(f'Unable to import iptc due to an error {err}')
logger.error(f'Unable to import nftables due to an error {err}')


@dataclass
Expand Down
5 changes: 2 additions & 3 deletions node_cli/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
from node_cli.core.checks import run_checks as run_host_checks
from node_cli.core.resources import update_resource_allocation
from node_cli.operations import (
configure_firewall,
configure_nftables,
update_op,
init_op,
turn_off_op,
Expand Down Expand Up @@ -260,7 +260,6 @@ def update(env_filepath: str, pull_config_for_schain: str, unsafe_ok: bool = Fal
error_exit(error_msg, exit_code=CLIExitCodes.UNSAFE_UPDATE)

prev_version = get_meta_info().version
logger.info('HERE %s %s', __version__, prev_version)
if (__version__ == 'test' or __version__.startswith('2.6')) and prev_version == '2.5.0':
migrate_2_6()
logger.info('Node update started')
Expand Down Expand Up @@ -467,4 +466,4 @@ def run_checks(


def configure_firewall_rules(enable_monitoring: bool = False) -> None:
configure_firewall(enable_monitoring=enable_monitoring)
configure_nftables(enable_monitoring=enable_monitoring)
19 changes: 19 additions & 0 deletions node_cli/migrations/focal_to_jammy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# -*- coding: utf-8 -*-
#
# This file is part of node-cli
#
# Copyright (C) 2019 SKALE Labs
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.


import logging

from node_cli.core.nftables import NFTablesManager
Expand Down
2 changes: 1 addition & 1 deletion node_cli/operations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
turn_on as turn_on_op,
restore as restore_op,
repair_sync as repair_sync_op,
configure_nftables as configure_firewall
configure_nftables as configure_nftables
)
1 change: 1 addition & 0 deletions node_cli/utils/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ def get_ssh_port(ssh_service_name='ssh'):


def remove_between_brackets(text: str, pattern: str) -> str:
""" Remove all lines between brackets where the bracket line starts with the pattern """
result = []
skip = 0
found_pattern = False
Expand Down

0 comments on commit fbc27e7

Please sign in to comment.