Skip to content

Commit

Permalink
Merge pull request #72 from zdc/T6007-equuleus
Browse files Browse the repository at this point in the history
cc_vyos: T6007: Run config migrations before Cloud-init
  • Loading branch information
c-po authored Feb 6, 2024
2 parents 9f8bdf9 + d24e690 commit e9842fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cloudinit/config/cc_vyos.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,10 @@ def handle(name, cfg, cloud, log, _args):
file_name = cfg_file_name

logger.debug("Using configuration file: {}".format(file_name))
# We must run all migrations on the config before Cloud-init will modify it
# Otherwise, regardless of proper syntax for the current version, migrations will be re-run with unpredictable result
logger.debug("Running migrations for: {}".format(file_name))
run(['/usr/libexec/vyos/run-config-migration.py', file_name])
with open(file_name, 'r') as f:
config_file = f.read()
config = ConfigTree(config_file)
Expand Down

0 comments on commit e9842fc

Please sign in to comment.