aboutsummaryrefslogtreecommitdiff
path: root/src/star.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/star.rs')
-rw-r--r--src/star.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/star.rs b/src/star.rs
index 65b9fa8..7d3c21d 100644
--- a/src/star.rs
+++ b/src/star.rs
@@ -11,7 +11,7 @@ use std::process::{ExitStatus};
use std::os::unix::process::ExitStatusExt;
use rand::Rng;
-use tokio::{process::Command};
+use std::{process::Command};
#[derive(Serialize, Deserialize, Debug)]
pub enum Address {
@@ -124,7 +124,7 @@ impl Star {
/// If the installation image doesn't exist in the default libvirtd pool, this will fail with
/// [`Error::MissingImage`][crate::errors::Error::MissingImage].
///
- pub async fn planet(&mut self, name: String, max_mem: Memory, max_cpus: CpuCount, disk_size_mb: u64, ship: Ship) -> Result<Planet, Error> {
+ pub fn planet(&mut self, name: String, max_mem: Memory, max_cpus: CpuCount, disk_size_mb: u64, ship: Ship) -> Result<Planet, Error> {
// Check for image on host machine
if self.remote {
@@ -135,8 +135,7 @@ impl Star {
"stat",
&format!("/var/lib/libvirt/images/{}", ship.make_pretty_name().clone())
])
- .output()
- .await?;
+ .output()?;
if output.status != ExitStatus::from_raw(0) {
return Err(Error::MissingImage(ship.name.clone()));
@@ -154,8 +153,7 @@ impl Star {
&format!("/var/lib/libvirt/images/{}.qcow2", name.clone()),
&format!("{}M", disk_size_mb)
])
- .output()
- .await?;
+ .output()?;
if output.status != ExitStatus::from_raw(0) {
return Err(Error::Allocation(String::from_utf8(output.stdout).unwrap()));
@@ -166,8 +164,7 @@ impl Star {
.args([
&format!("/var/lib/libvirt/images/{}", ship.make_pretty_name().clone()),
])
- .output()
- .await?;
+ .output()?;
if output.status != ExitStatus::from_raw(0) {
return Err(Error::MissingImage(ship.name.clone()));
@@ -181,8 +178,7 @@ impl Star {
&format!("/var/lib/libvirt/images/{}.qcow2", name.clone()),
&format!("{}M", disk_size_mb)
])
- .output()
- .await?;
+ .output()?;
if output.status != ExitStatus::from_raw(0) {
return Err(Error::Allocation(String::from_utf8(output.stdout).unwrap()));