summaryrefslogtreecommitdiff
path: root/cloudinit/atomic_helper.py
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-06-17 12:59:23 -0400
committerGitHub <noreply@github.com>2020-06-17 10:59:23 -0600
commit3d13a9dd469f354d0ddc1e36be37d743b5a57c73 (patch)
treeeb6fbcf7f66c5c67e7703858f93369e8934b9c34 /cloudinit/atomic_helper.py
parente01e3ed5444c8093de47229e20abec440530d549 (diff)
downloadvyos-cloud-init-3d13a9dd469f354d0ddc1e36be37d743b5a57c73.tar.gz
vyos-cloud-init-3d13a9dd469f354d0ddc1e36be37d743b5a57c73.zip
util: rename write_file's copy_mode parameter to preserve_mode (#439)
When updating the docstring to include it, I realised that the current name is somewhat misleading; this makes it a little easier to understand, I think.
Diffstat (limited to 'cloudinit/atomic_helper.py')
-rw-r--r--cloudinit/atomic_helper.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/atomic_helper.py b/cloudinit/atomic_helper.py
index 1f61faa2..485ff92f 100644
--- a/cloudinit/atomic_helper.py
+++ b/cloudinit/atomic_helper.py
@@ -11,10 +11,10 @@ LOG = logging.getLogger(__name__)
def write_file(filename, content, mode=_DEF_PERMS,
- omode="wb", copy_mode=False):
+ omode="wb", preserve_mode=False):
# open filename in mode 'omode', write content, set permissions to 'mode'
- if copy_mode:
+ if preserve_mode:
try:
file_stat = os.stat(filename)
mode = stat.S_IMODE(file_stat.st_mode)