Commit 8651ce3e authored by Heinz N. Gies's avatar Heinz N. Gies

Move default to top

parent 3d4c4693
Pipeline #14220056 passed with stages
in 7 minutes and 17 seconds
......@@ -83,23 +83,24 @@ impl<'a> Jail<'a> {
"vm" => self.idx.uuid.hyphenated().to_string(),
"file" => routes.to_str());
let mut routes_file = File::create(routes)?;
if !self.config.routes.is_empty() {
for (dest, gw) in self.config.routes.iter() {
routes_file.write_all(dest.as_bytes())?;
for nic in self.config.nics.clone() {
if nic.primary {
routes_file.write_all(b"default")?;
routes_file.write_all(b"\t")?;
routes_file.write_all(gw.as_bytes())?;
routes_file.write_all(nic.gateway.as_bytes())?;
routes_file.write_all(b"\n")?;
}
}
for nic in self.config.nics.clone() {
if nic.primary {
routes_file.write_all(b"default")?;
if !self.config.routes.is_empty() {
for (dest, gw) in self.config.routes.iter() {
routes_file.write_all(dest.as_bytes())?;
routes_file.write_all(b"\t")?;
routes_file.write_all(nic.gateway.as_bytes())?;
routes_file.write_all(gw.as_bytes())?;
routes_file.write_all(b"\n")?;
}
}
}
let id = start_jail(&self.idx.uuid, args)?;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment