From bc9c9aeb75a2d9e803669c855843ae455832515f Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 18 Jul 2024 19:09:11 +0200 Subject: [PATCH] refactor: simplify executable path handling Removed unnecessary os.path.realpath usage for sys.executable in both manage_hetzner_servers.py and update_local_config.py. This reduces complexity and potential for errors when resolving paths. No significant changes to functionality. This change will make scripts easier to maintain and execute. --- manage_hetzner_servers.py | 3 +-- update_local_config.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/manage_hetzner_servers.py b/manage_hetzner_servers.py index 1cd76ee..5b159e0 100644 --- a/manage_hetzner_servers.py +++ b/manage_hetzner_servers.py @@ -3,7 +3,6 @@ import configparser from hcloud import Client import argparse import pathlib -import os import sys UPDATE_SCRIPT_PATH = pathlib.Path(__file__).parent / "update_local_config.py" @@ -27,7 +26,7 @@ def delete_hetzner_server(client, server): def run_update_script(provider, location, server_type, interface, config_path): command = [ - os.path.realpath(sys.executable), + sys.executable, UPDATE_SCRIPT_PATH, "--provider", provider, diff --git a/update_local_config.py b/update_local_config.py index db7bf10..3bfb83b 100644 --- a/update_local_config.py +++ b/update_local_config.py @@ -11,7 +11,7 @@ SCRIPT_PATH = pathlib.Path(__file__).parent / "worker.py" def execute_script(provider, location, server_type): command = [ - os.path.realpath(sys.executable), + sys.executable, SCRIPT_PATH, "--provider", provider,