Skip to content

Commit

Permalink
Merge pull request ottomatica#26 from gjabell/master
Browse files Browse the repository at this point in the history
Slim only handles its own KVM machines (fix ottomatica#24)
  • Loading branch information
chrisparnin authored Jun 3, 2019
2 parents 521bb85 + 34aa602 commit a7c0c1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/providers/kvm.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class KVM {
}

async list() {
let output = (await this.exec(`list --all`)).toString();
let output = (await this.exec(`list --all --title`)).toString();
// format is:
// Id Name State
// ------------------
Expand All @@ -81,14 +81,17 @@ class KVM {
.split('\n')
.splice(2,)
.map(e => {
let [ id, name, state ] = e.trim().split(/\s+/);
let [ id, name, state, title ] = e.trim().split(/\s+/);

return {
id,
name,
state
state,
title
};
});
})
.filter(e => e.title === 'slim')
.map(e => { delete e.title; return e });
}

async getSSHConfig(name) {
Expand Down
1 change: 1 addition & 0 deletions scripts/kvm.xml.mustache
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>{{ name }}</name>
<title>slim</title>
<os>
<type>hvm</type>
<kernel>{{ kernel }}</kernel>
Expand Down

0 comments on commit a7c0c1f

Please sign in to comment.