update proxmox-schema to nix 0.24.1

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-06-01 15:05:43 +02:00 committed by Fabian Grünbichler
parent bd0a7cb223
commit 92069b224d
2 changed files with 4 additions and 3 deletions

View File

@ -18,7 +18,7 @@ textwrap = "0.11"
# the upid type needs this for 'getpid'
libc = { version = "0.2", optional = true }
nix = { version = "0.19", optional = true }
nix = { version = "0.24.1", optional = true }
proxmox-api-macro = { path = "../proxmox-api-macro", optional = true, version = "1.0.3" }

View File

@ -209,6 +209,7 @@ fn unescape_id(text: &str) -> Result<String, Error> {
#[cfg(feature = "upid-api-impl")]
mod upid_impl {
use std::os::unix::ffi::OsStrExt;
use std::sync::atomic::{AtomicUsize, Ordering};
use anyhow::{bail, format_err, Error};
@ -246,8 +247,8 @@ mod upid_impl {
worker_type: worker_type.to_owned(),
worker_id,
auth_id,
node: nix::sys::utsname::uname()
.nodename()
node: std::str::from_utf8(nix::sys::utsname::uname()?.nodename().as_bytes())
.map_err(|_| format_err!("non-utf8 nodename not supported"))?
.split('.')
.next()
.ok_or_else(|| format_err!("failed to get nodename from uname()"))?