config: init: fix crash in mirrors prompt (MR 2367)

This was missed in fc010bc7c8

Before this fix:

```
...

[18:34:35] Enable background timer to prevent repeated sudo authorization? (y/n) [n]: y
(020272) [18:34:44] ERROR: 'Config' object has no attribute 'mirrors_postmarketos'
(020272) [18:34:44] See also: <https://postmarketos.org/troubleshooting>
(020272) [18:34:44] Traceback (most recent call last):
  File "/home/arnavion/src/pmbootstrap/pmb/__init__.py", line 72, in main
    return config_init.frontend(args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arnavion/src/pmbootstrap/pmb/config/init.py", line 729, in frontend
    ask_for_additional_options(config)
  File "/home/arnavion/src/pmbootstrap/pmb/config/init.py", line 542, in ask_for_additional_options
    logging.info("Selected mirror:" f" {','.join(context.config.mirrors_postmarketos)}")
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/arnavion/src/pmbootstrap/pmb/core/config.py", line 130, in __getattribute__
    return super().__getattribute__(key)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Config' object has no attribute 'mirrors_postmarketos'
```
This commit is contained in:
Arnav Singh 2024-07-14 12:33:57 -07:00 committed by Oliver Smith
parent 1af44fb159
commit b98c5e2cab
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -539,7 +539,7 @@ def ask_for_additional_options(config):
# Mirrors
# prompt for mirror change
logging.info("Selected mirror:" f" {','.join(context.config.mirrors_postmarketos)}")
logging.info("Selected mirror:" f" {context.config.mirrors['pmaports']}")
if pmb.helpers.cli.confirm("Change mirror?", default=False):
mirror = ask_for_mirror()
config.mirrors["pmaports"] = mirror