mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-13 02:28:10 +00:00
address clippy issues in proxy-manager (#410)
This commit is contained in:
@ -10,7 +10,7 @@ use tokio::process::Command;
|
|||||||
const SYSTEMD_CONFIG_DIR: &str = "/etc/systemd/system";
|
const SYSTEMD_CONFIG_DIR: &str = "/etc/systemd/system";
|
||||||
const PROXY_PREFIX: &str = "onefuzz-proxy";
|
const PROXY_PREFIX: &str = "onefuzz-proxy";
|
||||||
|
|
||||||
fn build(data: &ConfigData) -> Result<HashMap<String, String>> {
|
fn build(data: &ConfigData) -> HashMap<String, String> {
|
||||||
let mut results = HashMap::new();
|
let mut results = HashMap::new();
|
||||||
|
|
||||||
for entry in &data.forwards {
|
for entry in &data.forwards {
|
||||||
@ -40,7 +40,7 @@ ExecStart=/lib/systemd/systemd-socket-proxyd {}:{}
|
|||||||
results.insert(service_filename, service);
|
results.insert(service_filename, service);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(results)
|
results
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn stop_service(service: &str) -> Result<()> {
|
async fn stop_service(service: &str) -> Result<()> {
|
||||||
@ -73,7 +73,7 @@ async fn restart_systemd() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn update(data: &ConfigData) -> Result<bool> {
|
pub async fn update(data: &ConfigData) -> Result<bool> {
|
||||||
let configs = build(data)?;
|
let configs = build(data);
|
||||||
let mut changed = false;
|
let mut changed = false;
|
||||||
|
|
||||||
let mut config_dir = tokio::fs::read_dir(SYSTEMD_CONFIG_DIR).await?;
|
let mut config_dir = tokio::fs::read_dir(SYSTEMD_CONFIG_DIR).await?;
|
||||||
|
Reference in New Issue
Block a user