From 343912e4540accd826b89cf254a7e2708e4cc585 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 3 Nov 2024 10:38:07 +0100 Subject: [PATCH] Remove "pipes" Python module dependency (#4336) This commit fixes the folowing warning at boot: <118>/usr/local/opnsense/scripts/OPNsense/Tinc/tincd.py:34: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13 --- security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py index 2f73ae60b6..7979c93002 100755 --- a/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py +++ b/security/tinc/src/opnsense/scripts/OPNsense/Tinc/tincd.py @@ -31,12 +31,12 @@ import os import sys import glob -import pipes import xml.etree.ElementTree import shutil import subprocess import ipaddress from lib import objects +from shlex import quote def write_file(filename, content, mode=0o600): dirname = '/'.join(filename.split('/')[0:-1]) @@ -92,7 +92,7 @@ def deploy(config_filename): if_up = list() if_up.append("#!/bin/sh") - if_up.append("ifconfig %s %s %s" % (interface_name, interface_family, pipes.quote(interface_address))) + if_up.append("ifconfig %s %s %s" % (interface_name, interface_family, quote(interface_address))) if_up.append("configctl interface %s %s" % (interface_configd, interface_name)) write_file("%s/tinc-up" % network.get_basepath(), '\n'.join(if_up) + "\n", 0o700)