MCPcopy Create free account
hub / github.com/ceph/ceph / write_tmp_file

Function write_tmp_file

src/ceph-node-proxy/ceph_node_proxy/util.py:216–223  ·  view source on GitHub ↗
(
    data: str, prefix_name: str = "node-proxy-"
)

Source from the content-addressed store, hash-verified

214
215
216def write_tmp_file(
217 data: str, prefix_name: str = "node-proxy-"
218) -> _TemporaryFileWrapper:
219 f = NamedTemporaryFile(prefix=prefix_name)
220 os.fchmod(f.fileno(), 0o600)
221 f.write(data.encode("utf-8"))
222 f.flush()
223 return f
224
225
226def _dict_diff(old: Any, new: Any) -> Any:

Callers 2

runMethod · 0.90

Calls 4

fchmodMethod · 0.45
writeMethod · 0.45
encodeMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected