python 3.12 warns on unrecognized escape sequences in string literals.
fuse_mount's admin-socket pyscript and mount's nft payload carry regex
and shell escapes (\., \d, \;) that are meant literally, so make those
strings raw. filesystem's get_mds_addr docstring had a stray \/ in the
example address, which is just a slash, so drop the backslash.
Signed-off-by: Kefu Chai <k.chai@proxmox.com>
def get_mds_addr(self, name):
"""
- Return the instance addr as a string, like "10.214.133.138:6807\/10825"
+ Return the instance addr as a string, like "10.214.133.138:6807/10825"
"""
info = self.get_mds(name)
if info:
return ""
def find_admin_socket(self):
- pyscript = """
+ pyscript = r"""
import glob
import re
import os
return files[0]
for f in files:
- pid = re.match(".*\.(\d+)\.asok$", f).group(1)
+ pid = re.match(r".*\.(\d+)\.asok$", f).group(1)
if os.path.exists("/proc/{{0}}".format(pid)):
with open("/proc/{{0}}/cmdline".format(pid), 'r') as proc_f:
contents = proc_f.read()
# Setup the NAT
gw = self._default_gateway()
- self.run_shell_payload(f"""
+ self.run_shell_payload(rf"""
set -e
if command -v iptables >/dev/null 2>&1 && sudo iptables -t nat -A POSTROUTING -s {self.ceph_brx_net} -o {gw} -j MASQUERADE 2>/dev/null; then