Merge ~npochet/charm-sysconfig:fix-unnecessary-grub into charm-sysconfig:master

Proposed by Nicolas Pochet
Status: Rejected
Rejected by: Drew Freiberger
Proposed branch: ~npochet/charm-sysconfig:fix-unnecessary-grub
Merge into: charm-sysconfig:master
Diff against target: 33 lines (+21/-2)
1 file modified
src/reactive/sysconfig.py (+21/-2)
Reviewer Review Type Date Requested Status
Drew Freiberger (community) Disapprove
Canonical IS Reviewers Pending
Review via email: mp+377438@code.launchpad.net

Commit message

Verify grub parameters and affinity

* Verify that grub parameters are set before running update_grub_file
function. If it is not verified, this function will run and set the
default options through the grub template which is undesirable.
* Verify that systemd parameters are set before running
update_systemd_system_file function.

Description of the change

Verify grub parameters and affinity

* Verify that grub parameters are set before running update_grub_file
function. If it is not verified, this function will run and set the
default options through the grub template which is undesirable.
* Verify that systemd parameters are set before running
update_systemd_system_file function.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Drew Freiberger (afreiberger) wrote :

I'm going to pick this up. I'd really like to see this functionality moved to the library and added unittests to ensure that the logic is being processed correctly. As I review the code for syshelper.charm_config, I see that is deprecated and shouldn't be the only source for determining the running of grub, as there are now also grub_config_flags to check.

review: Needs Fixing
Revision history for this message
Drew Freiberger (afreiberger) wrote :
review: Disapprove

Unmerged commits

b844615... by Nicolas Pochet

Verify grub parameters and affinity

* Verify that grub parameters are set before running update_grub_file
function. If it is not verified, this function will run and set the
default options through the grub template which is undesirable.
* Verify that systemd parameters are set before running
update_systemd_system_file function.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/reactive/sysconfig.py b/src/reactive/sysconfig.py
2index eba0916..ebfb55c 100644
3--- a/src/reactive/sysconfig.py
4+++ b/src/reactive/sysconfig.py
5@@ -52,8 +52,27 @@ def install_sysconfig():
6
7 syshelper.install_configured_kernel()
8 syshelper.update_cpufreq()
9- syshelper.update_grub_file()
10- syshelper.update_systemd_system_file()
11+ if any(syshelper.charm_config[flag] for flag in (
12+ 'reservation',
13+ 'hugepages',
14+ 'hugepagesz',
15+ 'raid-autodetection',
16+ 'enable-pti',
17+ 'enable-iommu',
18+ 'grub-config-flags',
19+ 'kernel-version',
20+ 'update-grub',
21+ 'config-flags',
22+ 'cpu-range',
23+ )) and syshelper.reservation not in ('off', 'affinity'):
24+ syshelper.update_grub_file()
25+ if any(syshelper.charm_config[flag] for flag in (
26+ 'reservation',
27+ 'systemd-config-flags',
28+ 'cpu-range',
29+ 'config-flags',
30+ )) and syshelper.reservation not in ('off', 'isolcpus'):
31+ syshelper.update_systemd_system_file()
32 set_flag('sysconfig.installed')
33 update_status()
34

Subscribers

People subscribed via source and target branches

to all changes: