Commit Graph

9 Commits

Author SHA1 Message Date
Dan Bungert 34d40643ad format with black + isort 2023-07-25 15:27:42 -06:00
Chad Smith a531ade6c3 file_util: generate_timestamped_header function to any subiquity written files 2022-07-14 21:48:51 -06:00
Dan Bungert 8ca83aa9cf file_util: genericize copy routine 2022-04-11 12:51:26 -06:00
Dan Bungert 4698dcd935 logging: raise warning when not adjusting perms 2022-03-14 09:48:19 -06:00
Dan Bungert 953998b23a logging: 0770 log dir in install env, 0750 later 2022-03-11 12:44:22 -07:00
Dan Bungert 42db747a0d file_util: remove omode / copy_mode
omode used to be in use, but has been standardized to 'w'.
copy_mode was unused.  Remove both.
2022-02-14 11:23:39 -07:00
Dan Bungert f4a9836143 file_util generate_config -> generate_config_yaml
The two usages of generate_config were both for yaml, so make that
simpler.
2022-02-14 11:21:56 -07:00
Dan Bungert 9b5513f311 file_util: add open_perms and generate_config
Create open_perms context manager for custom or multiple writes.
Create generate_config for a small removal of redundancy.
0640 root:adm the resulting files.
2022-02-14 11:14:10 -07:00
Scott Moser 3e69673501 Fix writing of netplan configs
When user configures network with subiquity, it's rendered
netplan should be wholly definitive.  So, we remove the other files
that may have config.  This fixes a bug where running in an instance
when running on a system where cloud-init had rendered a 'match' with
'macaddress'.

When writing netplan we keep 'macaddress' match in place but drop
others.  The others may just wildcard from the installer environment,
but macaddress are likely by cloud-init or otherwise intentionally
written.

Also add an atomic write in subiquitycore/file_util and move the
netplan code into subiquitycore/netplan.py, and add some unit test
helpers from cloud-init.
2018-06-07 11:46:34 -04:00