فهرست منبع

Fix generate-borgmatic-config with "--source" flag to support more complex schema changes like the new Healthchecks configuration options (#536).

Dan Helfman 3 سال پیش
والد
کامیت
be59a3e574
4فایلهای تغییر یافته به همراه8 افزوده شده و 2 حذف شده
  1. 4 0
      NEWS
  2. 2 1
      borgmatic/config/generate.py
  3. 1 1
      setup.py
  4. 1 0
      tests/integration/config/test_generate.py

+ 4 - 0
NEWS

@@ -1,3 +1,7 @@
+1.6.2.dev0
+ * #536: Fix generate-borgmatic-config with "--source" flag to support more complex schema changes
+   like the new Healthchecks configuration options.
+
 1.6.1
  * #294: Add Healthchecks monitoring hook "ping_body_limit" option to configure how many bytes of
    logs to send to the Healthchecks server.

+ 2 - 1
borgmatic/config/generate.py

@@ -5,7 +5,7 @@ import re
 
 from ruamel import yaml
 
-from borgmatic.config import load
+from borgmatic.config import load, normalize
 
 INDENT = 4
 SEQUENCE_INDENT = 2
@@ -275,6 +275,7 @@ def generate_sample_configuration(source_filename, destination_filename, schema_
 
     if source_filename:
         source_config = load.load_configuration(source_filename)
+        normalize.normalize(source_config)
 
     destination_config = merge_source_configuration_into_destination(
         _schema_to_sample_configuration(schema), source_config

+ 1 - 1
setup.py

@@ -1,6 +1,6 @@
 from setuptools import find_packages, setup
 
-VERSION = '1.6.1'
+VERSION = '1.6.2.dev0'
 
 
 setup(

+ 1 - 0
tests/integration/config/test_generate.py

@@ -212,6 +212,7 @@ def test_generate_sample_configuration_with_source_filename_does_not_raise():
     builtins.should_receive('open').with_args('schema.yaml').and_return('')
     flexmock(module.yaml).should_receive('round_trip_load')
     flexmock(module.load).should_receive('load_configuration')
+    flexmock(module.normalize).should_receive('normalize')
     flexmock(module).should_receive('_schema_to_sample_configuration')
     flexmock(module).should_receive('merge_source_configuration_into_destination')
     flexmock(module).should_receive('render_configuration')