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.
This commit is contained in:
Kumi 2024-07-18 19:09:11 +02:00
parent 5a64f31a1c
commit bc9c9aeb75
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 2 additions and 3 deletions

View file

@ -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,

View file

@ -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,