[pbs-devel] [PATCH proxmox-backup] fix running_kernel string for unknown package case

Mira Limbeck m.limbeck at proxmox.com
Thu Nov 12 10:52:20 CET 2020


Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
I always use rustfmt for formatting as Wolfgang always urges us to do.
And it seems rather eager to put function arguments in new lines.

 src/api2/node/apt.rs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/api2/node/apt.rs b/src/api2/node/apt.rs
index 765ea525..09d56123 100644
--- a/src/api2/node/apt.rs
+++ b/src/api2/node/apt.rs
@@ -303,10 +303,13 @@ pub fn get_versions() -> Result<Vec<APTUpdateInfo>, Error> {
         None,
     );
 
-    let running_kernel = nix::sys::utsname::uname().release().to_owned();
+    let running_kernel = format!(
+        "running kernel: {}", 
+        nix::sys::utsname::uname().release().to_owned()
+    );
     if let Some(proxmox_backup) = pbs_packages.iter().find(|pkg| pkg.package == "proxmox-backup") {
         let mut proxmox_backup = proxmox_backup.clone();
-        proxmox_backup.extra_info = Some(format!("running kernel: {}", running_kernel));
+        proxmox_backup.extra_info = Some(running_kernel);
         packages.push(proxmox_backup);
     } else {
         packages.push(unknown_package("proxmox-backup".into(), Some(running_kernel)));
-- 
2.20.1






More information about the pbs-devel mailing list