diff options
author | John Estabrook <jestabro@vyos.io> | 2024-10-02 12:20:15 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2024-10-05 00:27:19 -0500 |
commit | f9c81b121b146fbcf3c458273b2b47e6e571f2e2 (patch) | |
tree | 942f3a172f2c4d958150157d4ba08169e6c7f324 /src/conf_mode | |
parent | 5a59d8529c56f844c6dc62ffa6377280f01bcec1 (diff) | |
download | vyos-1x-f9c81b121b146fbcf3c458273b2b47e6e571f2e2.tar.gz vyos-1x-f9c81b121b146fbcf3c458273b2b47e6e571f2e2.zip |
config-mgmt: T5976: normalize formatting
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/system_config-management.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/conf_mode/system_config-management.py b/src/conf_mode/system_config-management.py index c681a8405..99f25bef6 100755 --- a/src/conf_mode/system_config-management.py +++ b/src/conf_mode/system_config-management.py @@ -22,6 +22,7 @@ from vyos.config import Config from vyos.config_mgmt import ConfigMgmt from vyos.config_mgmt import commit_post_hook_dir, commit_hooks + def get_config(config=None): if config: conf = config @@ -36,22 +37,24 @@ def get_config(config=None): return mgmt + def verify(_mgmt): return + def generate(mgmt): if mgmt is None: return mgmt.initialize_revision() + def apply(mgmt): if mgmt is None: return locations = mgmt.locations - archive_target = os.path.join(commit_post_hook_dir, - commit_hooks['commit_archive']) + archive_target = os.path.join(commit_post_hook_dir, commit_hooks['commit_archive']) if locations: try: os.symlink('/usr/bin/config-mgmt', archive_target) @@ -68,8 +71,9 @@ def apply(mgmt): raise ConfigError from exc revisions = mgmt.max_revisions - revision_target = os.path.join(commit_post_hook_dir, - commit_hooks['commit_revision']) + revision_target = os.path.join( + commit_post_hook_dir, commit_hooks['commit_revision'] + ) if revisions > 0: try: os.symlink('/usr/bin/config-mgmt', revision_target) @@ -85,6 +89,7 @@ def apply(mgmt): except OSError as exc: raise ConfigError from exc + if __name__ == '__main__': try: c = get_config() |