deploy-local: Remove "symlink is current" check
DeployLocal.config_deploy():
Removed the logic enables dry-run (self.noop == True) mode if a
symlink already exists which points to the current rev directory.
The logic has some flaws:
-
Enabling dry-run mode will happen the first time a "current"
symlink is seen, without regard for the state or configuration of
other config files. -
Just because the symlink points into the current rev directory
doesn't mean that config file exists in the rev directory yet (for
example, if someone deleted the scap deploy cache and then re-ran
scap deploy-local
).
Overall, it's unclear what problem was being solved by the symlink
checks, so I removed the logic outright.
To compensate for this I changed the config file rendering code to
use utils.write_file_if_needed()
which will only update a config
file when needed, and when it does, it updates the file atomically.
Bug: T342162
Related MRs:
- !352 (merged) (This MR)
- !353 (merged)
- master