← Back to team overview

curtin-dev team mailing list archive

[Merge] ~dgadomski/curtin:grub-config-not-subsciptable into curtin:master

 

Dariusz Gadomski has proposed merging ~dgadomski/curtin:grub-config-not-subsciptable into curtin:master.

Commit message:
curthooks: fix deprecated GrubConfig properties syntax
    
There was a leftover example of accessing GrubConfig properties that has
been removed by commit 4587fd40dfd7eabd6677004e91340edcfe5a7472.


Requested reviews:
  curtin developers (curtin-dev)

For more details, see:
https://code.launchpad.net/~dgadomski/curtin/+git/curtin/+merge/466000

If the user tries to run an automated installation and will set
storage.grub.install_devices most likely they will end up in hitting curtin/commands/curthooks.py:782:
LOG.warn("Storage Config grub device config takes precedence "
                         "over grub 'install_devices' value, ignoring: %s",
                         grubcfg['install_devices'])

This will lead to:
TypeError: 'GrubConfig' object is not subscriptable
'GrubConfig' object is not subscriptable

The syntax used in this line is a pre-refactoring leftover probably skipped by mistake in commit 4587fd40dfd7eabd6677004e91340edcfe5a7472.
-- 
Your team curtin developers is requested to review the proposed merge of ~dgadomski/curtin:grub-config-not-subsciptable into curtin:master.
diff --git a/curtin/commands/curthooks.py b/curtin/commands/curthooks.py
index 34ff660..264d7d0 100644
--- a/curtin/commands/curthooks.py
+++ b/curtin/commands/curthooks.py
@@ -779,7 +779,7 @@ def setup_grub(
                grubcfg.install_devices is not grubcfg.install_devices_default:
                 LOG.warn("Storage Config grub device config takes precedence "
                          "over grub 'install_devices' value, ignoring: %s",
-                         grubcfg['install_devices'])
+                         grubcfg.install_devices)
             grubcfg.install_devices = storage_grub_devices
 
     LOG.debug("install_devices: %s", grubcfg.install_devices)

Follow ups