When writing config, make containing directory if necessary. Also default to tighter permissions.
This commit is contained in:
parent
f98558546c
commit
61f88228b0
2 changed files with 27 additions and 7 deletions
|
|
@ -42,7 +42,7 @@ def parse_arguments(*arguments):
|
|||
def main(): # pragma: no cover
|
||||
try:
|
||||
# TODO: Detect whether only legacy config is present. If so, inform the user about how to
|
||||
# upgrade, then exet.
|
||||
# upgrade, then exit.
|
||||
|
||||
args = parse_arguments(*sys.argv[1:])
|
||||
config = parse_configuration(args.config_filename, schema_filename())
|
||||
|
|
|
|||
|
|
@ -87,8 +87,11 @@ def main(): # pragma: no cover
|
|||
|
||||
destination_config = convert.convert_legacy_parsed_config(source_config, source_excludes, schema)
|
||||
|
||||
generate.write_configuration(args.destination_config_filename, destination_config)
|
||||
os.chmod(args.destination_config_filename, source_config_file_mode)
|
||||
generate.write_configuration(
|
||||
args.destination_config_filename,
|
||||
destination_config,
|
||||
mode=source_config_file_mode,
|
||||
)
|
||||
|
||||
# TODO: As a backstop, check that the written config can actually be read and parsed, and
|
||||
# that it matches the destination config data structure that was written.
|
||||
|
|
|
|||
Loading…
Reference in a new issue