aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/planet.rs14
-rw-r--r--src/ship.rs3
-rw-r--r--src/star.rs6
3 files changed, 18 insertions, 5 deletions
diff --git a/src/planet.rs b/src/planet.rs
index be81e7e..8775f15 100644
--- a/src/planet.rs
+++ b/src/planet.rs
@@ -296,6 +296,20 @@ impl Planet {
Ok(())
}
+
+ pub fn deathstar(&self) -> Result<(), Error> {
+ let d = match &self.domain {
+ Some(d) => d,
+ None => {
+ return Err(Error::Other(String::from("No domain connection found")));
+ }
+ };
+
+ self.shutdown()?;
+ d.undefine()?;
+
+ Ok(())
+ }
}
#[cfg(test)]
diff --git a/src/ship.rs b/src/ship.rs
index 6466a5f..7b684b3 100644
--- a/src/ship.rs
+++ b/src/ship.rs
@@ -94,6 +94,7 @@ impl Ship {
])
.output()?;
} else {
+ println!("Not remote");
output = Command::new("wget")
.args([
"-O",
@@ -112,7 +113,7 @@ impl Ship {
pub fn make_pretty_name(&self) -> String {
let safe_name = self.name.clone().to_lowercase().replace(" ", "-");
- let file_name = format!("{}-{}-{}.van", safe_name, self.version.clone(), self.shasum.0.clone());
+ let file_name = format!("{}-{}-{}.ship", safe_name, self.version.clone(), self.shasum.0.clone());
file_name
}
diff --git a/src/star.rs b/src/star.rs
index 7d3c21d..75368cd 100644
--- a/src/star.rs
+++ b/src/star.rs
@@ -67,9 +67,9 @@ impl Star {
let c = Connect::open(&url.clone())?;
let remote = if url.contains("qemu:///") || url.contains("localhost") || url.contains("127.0.0.1") {
- true
- } else {
false
+ } else {
+ true
};
// If the connection succeeds, we've got one!
@@ -203,8 +203,6 @@ impl Star {
let buf = String::from_utf8(buf).unwrap();
- println!("{}", buf);
-
let dom: Domain = match &self.con {
Some(c) => {
let dom = Domain::define_xml(&c, &buf)?;