update to nix 0.24 / rustyline 9 / proxmox-sys 0.3
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use serde_json::{json, Value};
|
||||
use std::collections::HashMap;
|
||||
use std::os::unix::prelude::OsStrExt;
|
||||
|
||||
use proxmox_router::{
|
||||
list_subdirs_api_method, Permission, Router, RpcEnvironment, RpcEnvironmentType, SubdirMap,
|
||||
@ -360,7 +361,7 @@ pub fn get_versions() -> Result<Vec<APTUpdateInfo>, Error> {
|
||||
|
||||
let running_kernel = format!(
|
||||
"running kernel: {}",
|
||||
nix::sys::utsname::uname().release().to_owned()
|
||||
std::str::from_utf8(nix::sys::utsname::uname()?.release().as_bytes())?.to_owned()
|
||||
);
|
||||
if let Some(proxmox_backup) = pbs_packages
|
||||
.iter()
|
||||
|
@ -1,5 +1,5 @@
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::{os::unix::prelude::OsStrExt, path::Path};
|
||||
|
||||
use anyhow::{bail, format_err, Error};
|
||||
use serde_json::Value;
|
||||
@ -69,12 +69,12 @@ fn get_status(
|
||||
let cpuinfo = procfs::read_cpuinfo()?;
|
||||
let cpuinfo = cpuinfo.into();
|
||||
|
||||
let uname = nix::sys::utsname::uname();
|
||||
let uname = nix::sys::utsname::uname()?;
|
||||
let kversion = format!(
|
||||
"{} {} {}",
|
||||
uname.sysname(),
|
||||
uname.release(),
|
||||
uname.version()
|
||||
std::str::from_utf8(uname.sysname().as_bytes())?,
|
||||
std::str::from_utf8(uname.release().as_bytes())?,
|
||||
std::str::from_utf8(uname.version().as_bytes())?
|
||||
);
|
||||
|
||||
Ok(NodeStatus {
|
||||
|
@ -60,7 +60,7 @@ pub fn create_configdir() -> Result<(), Error> {
|
||||
|
||||
match nix::unistd::mkdir(cfgdir, Mode::from_bits_truncate(0o700)) {
|
||||
Ok(()) => {}
|
||||
Err(nix::Error::Sys(nix::errno::Errno::EEXIST)) => {
|
||||
Err(nix::errno::Errno::EEXIST) => {
|
||||
check_configdir_permissions()?;
|
||||
return Ok(());
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ pub fn update_apt_auth(key: Option<String>, password: Option<String>) -> Result<
|
||||
}
|
||||
_ => match nix::unistd::unlink(auth_conf) {
|
||||
Ok(()) => Ok(()),
|
||||
Err(nix::Error::Sys(nix::errno::Errno::ENOENT)) => Ok(()), // ignore not existing
|
||||
Err(nix::errno::Errno::ENOENT) => Ok(()), // ignore not existing
|
||||
Err(err) => Err(err),
|
||||
}
|
||||
.map_err(|e| format_err!("Error clearing apt auth config - {}", e))?,
|
||||
|
Reference in New Issue
Block a user