diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-08-03 09:34:08 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-08-05 10:12:21 +0300 |
commit | 37efe8e3d022d21bd2f6af741c8d5ee49da2fff5 (patch) | |
tree | eb301167c07657836ca5b9fdb6e044da8242e976 /src/install.rs | |
parent | c15ca42605d760d519721a3e39e1834ac5b1cb15 (diff) | |
download | vmadm-37efe8e3d022d21bd2f6af741c8d5ee49da2fff5.tar.gz |
feat: if no networks are specified, use default
Also, drop lan, wan from test config, because we can't assume they're
available in the environment the tests are run in.
Sponsored-by: author
Diffstat (limited to 'src/install.rs')
-rw-r--r-- | src/install.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/install.rs b/src/install.rs index ce2cc0b..17b7be8 100644 --- a/src/install.rs +++ b/src/install.rs @@ -6,7 +6,6 @@ use crate::cloudinit::{CloudInitConfig, CloudInitError}; use crate::image::VirtualMachineImage; -use log::debug; use std::path::{Path, PathBuf}; use std::process::Command; use std::result::Result; @@ -109,17 +108,13 @@ impl VirtInstallArgs { /// Create new VM with virt-install. pub fn virt_install(args: &VirtInstallArgs, iso: &Path) -> Result<PathBuf, VirtInstallError> { - args.init().create_iso(&iso)?; - let networks: Vec<String> = args .networks .iter() .map(|s| format!("--network=network={}", s)) .collect(); - debug!("virt-install networks: {:?}", networks); - if networks.is_empty() { - return Err(VirtInstallError::NoNetworks(args.name.clone())); - } + + args.init().create_iso(iso)?; let r = Command::new("virt-install") .arg("--name") |