]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephadm: convert some functions to use write_new
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 6 Jun 2023 00:12:59 +0000 (20:12 -0400)
committerAdam King <adking@redhat.com>
Thu, 31 Aug 2023 17:35:13 +0000 (13:35 -0400)
commitbeaa46e6bd0a8956947ff158d7ab3b183dc58639
treea1d7d5d99a1768a80a5aad88ce1910a2e71f389e
parente0bd41a13b649813fa5a21897347d90e1d8e4cd4
cephadm: convert some functions to use write_new

Convert a lot of the basic uses of the pattern:
with open(...) as f:
  f.write(...)
  os.fchown(f, ...)  # sometimes
  os.fchmod(f, ...)  # sometimes
  os.rename(...)   # sometimes

These are the most obvious cases to convert to `write_new`
and should largely be uncontroversial.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 300f5bfcb5dd16ba916951bab90c95a1b76d07f4)
src/cephadm/cephadm.py