Potential fix of set tech in the container + logging
This commit is contained in:
parent
61adbd7a28
commit
5caa570055
@ -263,11 +263,15 @@ func (c *Container) SetTechnology(tech string, version string) error {
|
|||||||
var err error
|
var err error
|
||||||
|
|
||||||
// TODO: script injection here?
|
// TODO: script injection here?
|
||||||
|
var output *[]byte
|
||||||
if version == "" {
|
if version == "" {
|
||||||
_, err = driver.Exec(c.App.Name, []string{"su", "app", "-c", "rosti " + tech}, "", []string{}, false)
|
output, err = driver.Exec(c.App.Name, []string{"su", "app", "-c", "rosti " + tech}, "", []string{}, false)
|
||||||
} else {
|
} else {
|
||||||
_, err = driver.Exec(c.App.Name, []string{"su", "app", "-c", "rosti " + tech + " " + version}, "", []string{}, false)
|
output, err = driver.Exec(c.App.Name, []string{"su", "app", "-c", "rosti " + tech + " " + version}, "", []string{}, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Printf("DEBUG: enable tech for %s output: %s", c.App.Name, string(*output))
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,9 @@ import (
|
|||||||
"github.com/rosti-cz/node-api/node"
|
"github.com/rosti-cz/node-api/node"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Wait for the container a little bit longer
|
||||||
|
const ENABLE_TECH_WAIT = 10
|
||||||
|
|
||||||
// Processor separates logic of apps, containers, detector and node from handlers.
|
// Processor separates logic of apps, containers, detector and node from handlers.
|
||||||
// It defines common interface for both types of handlers, HTTP and the events.
|
// It defines common interface for both types of handlers, HTTP and the events.
|
||||||
type Processor struct {
|
type Processor struct {
|
||||||
@ -455,6 +458,8 @@ func (p *Processor) EnableTech(service, version string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time.Sleep(ENABLE_TECH_WAIT * time.Second)
|
||||||
|
|
||||||
container, err := p.getContainer()
|
container, err := p.getContainer()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user