public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Christoph Heiss <c.heiss@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH installer 1/8] install: drop trivial fromjs() wrapper and use JSON::from_json()
Date: Fri,  8 May 2026 20:44:04 +0200	[thread overview]
Message-ID: <20260508184546.113293-2-c.heiss@proxmox.com> (raw)
In-Reply-To: <20260508184546.113293-1-c.heiss@proxmox.com>

.. in preparation for moving some subroutines.

No functional changes.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 Proxmox/Install/RunEnv.pm | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/Proxmox/Install/RunEnv.pm b/Proxmox/Install/RunEnv.pm
index a53fa8e..40041ad 100644
--- a/Proxmox/Install/RunEnv.pm
+++ b/Proxmox/Install/RunEnv.pm
@@ -14,10 +14,6 @@ use Proxmox::Sys::Net;
 
 use Proxmox::Install::ISOEnv;
 
-my sub fromjs : prototype($) {
-    return from_json($_[0], { utf8 => 1 });
-}
-
 my $_cached_arch = undef;
 
 sub query_arch : prototype() {
@@ -106,7 +102,7 @@ my sub query_netdevs : prototype() {
     my $default;
 
     # FIXME: not the same as the battle proven way we used in the installer for years?
-    my $interfaces = fromjs(qx/ip --details --json address show/);
+    my $interfaces = from_json(qx/ip --details --json address show/, { utf8 => 1 });
 
     my $pinned_counter = 0;
     for my $if (@$interfaces) {
@@ -178,7 +174,7 @@ my sub query_routes : prototype() {
     my ($gateway4, $gateway6);
 
     log_info("query routes");
-    my $route4 = fromjs(qx/ip -4 --json route show/);
+    my $route4 = from_json(qx/ip -4 --json route show/, { utf8 => 1 });
     for my $route (@$route4) {
         if ($route->{dst} eq 'default') {
             $gateway4 = {
@@ -189,7 +185,7 @@ my sub query_routes : prototype() {
         }
     }
 
-    my $route6 = fromjs(qx/ip -6 --json route show/);
+    my $route6 = from_json(qx/ip -6 --json route show/, { utf8 => 1 });
     for my $route (@$route6) {
         if ($route->{dst} eq 'default') {
             $gateway6 = {
@@ -310,7 +306,7 @@ sub query_installation_environment : prototype() {
         log_info("re-using cached runtime env from $run_env_file");
         my $cached_env = eval {
             my $run_env_raw = Proxmox::Sys::File::file_read_all($run_env_file);
-            return fromjs($run_env_raw); # returns from eval
+            return from_json($run_env_raw, { utf8 => 1 }); # returns from eval
         };
         log_error("failed to parse cached runtime env - $@") if $@;
         return $cached_env if defined($cached_env) && scalar keys $cached_env->%*;
-- 
2.53.0





  reply	other threads:[~2026-05-08 18:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 18:44 [PATCH installer 0/8] add IPv6 SLAAC and v6-only support Christoph Heiss
2026-05-08 18:44 ` Christoph Heiss [this message]
2026-05-08 18:44 ` [PATCH installer 2/8] install: move network subroutines to Proxmox::Sys::Net Christoph Heiss
2026-05-08 18:44 ` [PATCH installer 3/8] gui: use run_env->{network} instead of old run_env->{ipconf} Christoph Heiss
2026-05-08 18:44 ` [PATCH installer 4/8] sys: net: drop the now-unused `ipconf` runtime environment configuration Christoph Heiss
2026-05-08 18:44 ` [PATCH installer 5/8] sys: net: allow up to /128 netmask for IPv6 Christoph Heiss
2026-05-08 18:44 ` [PATCH RFC installer 6/8] sys: net: ignore ipv6 nameservers with zone identifiers Christoph Heiss
2026-05-08 18:44 ` [PATCH installer 7/8] common: options: rework network address setup to handle ipv6-only Christoph Heiss
2026-05-08 18:44 ` [PATCH installer 8/8] unconfigured: try to retrieve IPv6 SLAAC addresses on startup Christoph Heiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260508184546.113293-2-c.heiss@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal