1
0
Fork 0

Ignore templates in vm list, fix mistake in copyFiles

master
dump_stack() 2018-07-12 07:34:18 +00:00
parent 252610af57
commit 6f07028ad1
1 changed files with 5 additions and 3 deletions

View File

@ -114,16 +114,18 @@ func list(l *libvirt.Libvirt) {
} }
for _, f := range files { for _, f := range files {
if f.Name() != "base.nix" && f.Name() != "local.nix" && f.Name() != "monitor.nix" { if f.Name() != "base.nix" &&
f.Name() != "local.nix" && f.Name() != "monitor.nix" &&
f.Name() != "local.nix.template" && f.Name() != "monitor.nix.template" {
fmt.Println("\t", f.Name()[0:len(f.Name())-4]) fmt.Println("\t", f.Name()[0:len(f.Name())-4])
} }
} }
} }
func copyFile(to, from string) (err error) { func copyFile(from, to string) (err error) {
source, err := os.Open(from) source, err := os.Open(from)
if err != nil { if err != nil {
return err return
} }
defer source.Close() defer source.Close()