summaryrefslogtreecommitdiff
path: root/python/vyos/migrator.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2020-03-31 04:53:08 +0700
committerGitHub <noreply@github.com>2020-03-31 04:53:08 +0700
commit41f810998729057a05f240625fffe946d2bf4711 (patch)
treec766470ec065a0edb9eeddd97fc27512dff891de /python/vyos/migrator.py
parent69dda9497229b56bf68e7e66135688561598b892 (diff)
parent1c74d7ec8a239427c8f7e9f6d864c5085372b0e6 (diff)
downloadvyos-1x-41f810998729057a05f240625fffe946d2bf4711.tar.gz
vyos-1x-41f810998729057a05f240625fffe946d2bf4711.zip
Merge pull request #286 from jestabro/change-trailing-syntax
Change trailing syntax
Diffstat (limited to 'python/vyos/migrator.py')
-rw-r--r--python/vyos/migrator.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/python/vyos/migrator.py b/python/vyos/migrator.py
index f05228041..9a5fdef2f 100644
--- a/python/vyos/migrator.py
+++ b/python/vyos/migrator.py
@@ -25,7 +25,7 @@ class MigratorError(Exception):
pass
class Migrator(object):
- def __init__(self, config_file, force=False, set_vintage=None):
+ def __init__(self, config_file, force=False, set_vintage='vyos'):
self._config_file = config_file
self._force = force
self._set_vintage = set_vintage
@@ -61,9 +61,6 @@ class Migrator(object):
if self._set_vintage:
self._config_file_vintage = self._set_vintage
- if not self._config_file_vintage:
- self._config_file_vintage = vyos.defaults.cfg_vintage
-
if self._config_file_vintage not in ['vyatta', 'vyos']:
raise MigratorError("Unknown vintage.")
@@ -204,16 +201,12 @@ class Migrator(object):
return self._changed
class VirtualMigrator(Migrator):
- def __init__(self, config_file, vintage='vyos'):
- super().__init__(config_file, set_vintage = vintage)
-
def run(self):
cfg_file = self._config_file
cfg_versions = self.read_config_file_versions()
if not cfg_versions:
- raise MigratorError("Config file has no version information;"
- " virtual migration not possible.")
+ return
if self.update_vintage():
self._changed = True