all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH backup 2/2] api: time: rename read_etc_localtime
Date: Thu, 18 Jun 2026 09:49:01 +0200	[thread overview]
Message-ID: <20260618074926.1464533-2-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20260618074926.1464533-1-m.sandoval@proxmox.com>

The function tries to get the timezone from timedatectl and fallbacks to
/etc/localtime, so we rename it to get_timezone.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---

Notes:
    Whether timedatectl uses /etc/localtime is an implementation detail, but
    please feel free to drop this commit if it does not add much.

 src/api2/node/time.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/api2/node/time.rs b/src/api2/node/time.rs
index 9ab4e84d8..55de0d8ff 100644
--- a/src/api2/node/time.rs
+++ b/src/api2/node/time.rs
@@ -8,7 +8,7 @@ use proxmox_schema::api;
 
 use pbs_api_types::{NODE_SCHEMA, PRIV_SYS_MODIFY, TIME_ZONE_SCHEMA};
 
-fn read_etc_localtime() -> Result<String, Error> {
+fn get_timezone() -> Result<String, Error> {
     if let Ok(timezone) = timedatectl_get_timezone() {
         return Ok(timezone);
     }
@@ -118,7 +118,7 @@ fn get_time(_param: Value) -> Result<Value, Error> {
     let localtime = time + offset;
 
     Ok(json!({
-        "timezone": read_etc_localtime()?,
+        "timezone": get_timezone()?,
         "time": time,
         "localtime": localtime,
     }))
-- 
2.47.3





  reply	other threads:[~2026-06-18  7:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18  7:49 [PATCH backup 1/2] fix #7175: api: time: use timedatectl instead of /etc/timezone Maximiliano Sandoval
2026-06-18  7:49 ` Maximiliano Sandoval [this message]
2026-06-18  7:51 ` Maximiliano Sandoval

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=20260618074926.1464533-2-m.sandoval@proxmox.com \
    --to=m.sandoval@proxmox.com \
    --cc=pbs-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal