Signed-off-by: Lukas Wagner <l.wag...@proxmox.com> --- pve-rs/src/notify.rs | 11 +++++++++++ 1 file changed, 11 insertions(+)
diff --git a/pve-rs/src/notify.rs b/pve-rs/src/notify.rs index 04e902c..0c00b03 100644 --- a/pve-rs/src/notify.rs +++ b/pve-rs/src/notify.rs @@ -60,6 +60,11 @@ impl Context for PVEContext { .and_then(|content| lookup_datacenter_config_key(&content, "mail_from")) .unwrap_or_else(|| String::from("root")) } + + fn http_proxy_config(&self) -> Option<String> { + let content = attempt_file_read("/etc/pve/datacenter.cfg"); + content.and_then(|content| lookup_datacenter_config_key(&content, "http_proxy")) + } } #[cfg(test)] @@ -87,6 +92,7 @@ user:no-mail@pve:1:0:::::: const DC_CONFIG: &str = " email_from: u...@example.com +http_proxy: http://localhost:1234 keyboard: en-us "; #[test] @@ -95,6 +101,11 @@ keyboard: en-us lookup_datacenter_config_key(DC_CONFIG, "email_from"), Some("u...@example.com".to_string()) ); + assert_eq!( + lookup_datacenter_config_key(DC_CONFIG, "http_proxy"), + Some("http://localhost:1234".to_string()) + ); + assert_eq!(lookup_datacenter_config_key(DC_CONFIG, "foo"), None); } } -- 2.39.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel