Copy templates at start of tool not vm

This commit is contained in:
Mikhail Klementev 2020-01-09 23:24:18 +00:00
parent 2146397906
commit 8b271a3e5e
No known key found for this signature in database
GPG Key ID: BE44DA8C062D87DC

View File

@ -256,18 +256,12 @@ func start(l *libvirt.Libvirt, name string, verbose, online, stateless bool,
} }
} }
// Copy templates
err := prepareTemplates(appvmPath)
if err != nil {
log.Fatal(err)
}
if !isRunning(l, vmName) { if !isRunning(l, vmName) {
if !verbose { if !verbose {
go stupidProgressBar() go stupidProgressBar()
} }
err = generateAppVM(l, name, vmName, appvmPath, sharedDir, err := generateAppVM(l, name, vmName, appvmPath, sharedDir,
verbose, online) verbose, online)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
@ -430,6 +424,12 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
// Copy templates
err = prepareTemplates(configDir)
if err != nil {
log.Fatal(err)
}
kingpin.Command("list", "List applications") kingpin.Command("list", "List applications")
autoballonCommand := kingpin.Command("autoballoon", "Automatically adjust/reduce app vm memory") autoballonCommand := kingpin.Command("autoballoon", "Automatically adjust/reduce app vm memory")
minMemory := autoballonCommand.Flag("min-memory", "Set minimal memory (megabytes)").Default("1024").Uint64() minMemory := autoballonCommand.Flag("min-memory", "Set minimal memory (megabytes)").Default("1024").Uint64()