From 67bdc29abd609faa76e2a39f7c7ec408dea086ef Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Wed, 23 Jul 2025 15:03:01 +0200 Subject: [PATCH] refs #2526 fix bugs --- CHANGELOG.md | 6 ++++++ ogclient/etc/preinit.py | 5 +++-- ogclient/interfaceAdm/GetGitData | 0 ogclient/lib/python3/GitLib/__init__.py | 1 - ogclient/lib/python3/InitLib.py | 5 +++-- 5 files changed, 12 insertions(+), 5 deletions(-) mode change 100644 => 100755 ogclient/interfaceAdm/GetGitData diff --git a/CHANGELOG.md b/CHANGELOG.md index 3615a4e..dd48fac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.1] - 2025-07-23 + +### Fixed + +- Fixed small bugs in the py init scripts + ## [1.0.0] - 2025-07-18 ### Changed diff --git a/ogclient/etc/preinit.py b/ogclient/etc/preinit.py index d2b7e12..f94d614 100755 --- a/ogclient/etc/preinit.py +++ b/ogclient/etc/preinit.py @@ -4,8 +4,9 @@ import os import sys OPENGNSYS = os.environ.get ('OPENGNSYS', '/opt/opengnsys') -os.environ['PYTHONPATH'] = f'{OPENGNSYS}/lib/python3' -sys.path.insert (0, os.environ['PYTHONPATH']) +libs = [f'{OPENGNSYS}/lib/python3', '/usr/share/opengnsys-modules/python3/dist-packages'] +os.environ['PYTHONPATH'] = ':'.join (libs) +for l in libs: sys.path.insert (0, l) ## end import subprocess diff --git a/ogclient/interfaceAdm/GetGitData b/ogclient/interfaceAdm/GetGitData old mode 100644 new mode 100755 diff --git a/ogclient/lib/python3/GitLib/__init__.py b/ogclient/lib/python3/GitLib/__init__.py index 8791b0f..d9665fd 100755 --- a/ogclient/lib/python3/GitLib/__init__.py +++ b/ogclient/lib/python3/GitLib/__init__.py @@ -10,7 +10,6 @@ # import os import sys -sys.path.insert(0, "/usr/share/opengnsys-modules/python3/dist-packages") import shutil diff --git a/ogclient/lib/python3/InitLib.py b/ogclient/lib/python3/InitLib.py index b891dd0..fe5e916 100644 --- a/ogclient/lib/python3/InitLib.py +++ b/ogclient/lib/python3/InitLib.py @@ -95,7 +95,8 @@ def clean_esp(): if esp: esp_disk, esp_par = esp.split() mntpt = ogMount (esp_disk, esp_par) - os.unlink (f'{mntpt}/boot/grub/grub.cfg') + if os.path.exists (f'{mntpt}/boot/grub/grub.cfg'): + os.unlink (f'{mntpt}/boot/grub/grub.cfg') ogUnmount (esp_disk, esp_par) def fileslinks(): @@ -227,7 +228,7 @@ def filebeat(): os.chmod (F, 0o600) subprocess.run (['sed', '-i', - '-e', f's/__OGLOG_IP/{oglog}/g', + '-e', f's/__OGLOG_IP__/{oglog}/g', '-e', f's/__OGLOG_PORT__/{OPENSEARCH_PORT}/g', '-e', f's/__OPENSEARCH_PASSWORD__/{PASS}/g', F