Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.5.3 Stable (2.2.1 release) #1006

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.2
2.5.3
2 changes: 1 addition & 1 deletion core/schains/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def get_all(self, log: bool = True, save: bool = False, needed: Optional[List[st
needed=needed
)
plain_checks.update(subj_checks)
if not self.estate.ima_linked:
if not self.estate or not self.estate.ima_linked:
if 'ima_container' in plain_checks:
del plain_checks['ima_container']

Expand Down
14 changes: 8 additions & 6 deletions core/schains/monitor/config_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ def execute(self) -> None:

def run(self):
typename = type(self).__name__
logger.info('Config monitor type %s starting', typename)
self.am._upd_last_seen()
self.execute()
self.am.log_executed_blocks()
self.am._upd_last_seen()
logger.info('Config monitor type %s finished', typename)
logger.info('Config monitor type starting %s', typename)
try:
self.am._upd_last_seen()
self.execute()
self.am.log_executed_blocks()
self.am._upd_last_seen()
finally:
logger.info('Config monitor type finished %s', typename)


class RegularConfigMonitor(BaseConfigMonitor):
Expand Down
20 changes: 10 additions & 10 deletions core/schains/monitor/skaled_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ def execute(self) -> None:

def run(self):
typename = type(self).__name__
logger.info('Skaled monitor type %s starting', typename)
self.am._upd_last_seen()
self.execute()
self.am._upd_schain_record()
self.am.log_executed_blocks()
self.am._upd_last_seen()
logger.info('Skaled monitor type %s finished', typename)
logger.info('Skaled monitor type starting %s', typename)
try:
self.am._upd_last_seen()
self.execute()
self.am._upd_schain_record()
self.am.log_executed_blocks()
self.am._upd_last_seen()
finally:
logger.info('Skaled monitor type finished %s', typename)


class RegularSkaledMonitor(BaseSkaledMonitor):
Expand Down Expand Up @@ -233,9 +235,7 @@ def is_config_update_time(
) -> bool:
if not skaled_status:
return False
return not status['config_updated'] and \
not status['skaled_container'] and \
skaled_status.exit_time_reached
return not status['skaled_container'] and skaled_status.exit_time_reached


def is_recreate_mode(schain_record: SChainRecord) -> bool:
Expand Down
11 changes: 11 additions & 0 deletions tests/schains/monitor/skaled_monitor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ def test_get_skaled_monitor_new_node(
def test_get_skaled_monitor_update_config(
skaled_am,
skaled_checks_outdated_config,
skaled_checks_new_config,
schain_db,
skaled_status_exit_time_reached,
):
Expand All @@ -399,6 +400,16 @@ def test_get_skaled_monitor_update_config(
)
assert mon == UpdateConfigSkaledMonitor

status = skaled_checks_new_config.get_all()
status['skaled_container'] = False
mon = get_skaled_monitor(
skaled_am,
status,
schain_record,
skaled_status_exit_time_reached
)
assert mon == UpdateConfigSkaledMonitor


def test_get_skaled_monitor_recreate(
skaled_am,
Expand Down
Loading