diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-05-15 18:43:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 18:43:53 +0200 |
commit | 9f85fbeec5985f5cc66d290acd3e81577197a6c2 (patch) | |
tree | 247a04eca628c673fa290622a65dc40af02fbb22 /docs | |
parent | 7978ae7850aff13a7581e4f7f0a7ecaecd3906c6 (diff) | |
download | vyos-documentation-9f85fbeec5985f5cc66d290acd3e81577197a6c2.tar.gz vyos-documentation-9f85fbeec5985f5cc66d290acd3e81577197a6c2.zip |
development: add hint about config migration testing
Diffstat (limited to 'docs')
-rw-r--r-- | docs/contributing/development.rst | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/contributing/development.rst b/docs/contributing/development.rst index 66344ead..369f2127 100644 --- a/docs/contributing/development.rst +++ b/docs/contributing/development.rst @@ -755,6 +755,31 @@ In some rare cases, it may be useful to see what the OS is doing, including during boot. This option sends all commands used by VyOS to a file. The default file is ``/tmp/full-log`` but it can be changed. +Config Migration +---------------- + +When writing a new configuration migrator it may happen that you see an error when +you try to invoke it manually on a development system. This error will look like: + +.. code-block:: none + + vyos@vyos:~$ /opt/vyatta/etc/config-migrate/migrate/ssh/0-to-1 /tmp/config.boot + Traceback (most recent call last): + File "/opt/vyatta/etc/config-migrate/migrate/ssh/0-to-1", line 31, in <module> + config = ConfigTree(config_file) + File "/usr/lib/python3/dist-packages/vyos/configtree.py", line 134, in __init__ + raise ValueError("Failed to parse config: {0}".format(msg)) + ValueError: Failed to parse config: Syntax error on line 240, character 1: Invalid syntax. + +The reason is that the configuration migration backend is rewritten and uses a new form of +"magic string" which is applied on demand when real config migration is run on boot. When +runnint individual migrators for testing, you need to convert the "magic string" on your +own by: + +.. code-block:: none + + vyos@vyos3:~$ /usr/libexec/vyos/run-config-migration.py --virtual --set-vintage vyos /tmp/config.boot + Priorities ========== |