try writing out events
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
da2a24c549
commit
03eec14619
|
@ -112,11 +112,13 @@ func updateDroplet(d *DropletT, domcfg *libvirtxml.Domain) error {
|
||||||
// OS Type: &{Arch:x86_64 Machine:pc-i440fx-5.2 Type:hvm}
|
// OS Type: &{Arch:x86_64 Machine:pc-i440fx-5.2 Type:hvm}
|
||||||
t := domcfg.OS.Type
|
t := domcfg.OS.Type
|
||||||
if d.pb.QemuArch != t.Arch {
|
if d.pb.QemuArch != t.Arch {
|
||||||
alle = append(alle, NewChangeEvent(d.pb, "Droplet.QemuArch", d.pb.QemuArch, t.Arch))
|
e := NewChangeEvent(d.pb, "Droplet.QemuArch", d.pb.QemuArch, t.Arch)
|
||||||
|
alle = append(alle, e)
|
||||||
d.pb.QemuArch = t.Arch
|
d.pb.QemuArch = t.Arch
|
||||||
}
|
}
|
||||||
if d.pb.QemuMachine != t.Machine {
|
if d.pb.QemuMachine != t.Machine {
|
||||||
alle = append(alle, NewChangeEvent(d.pb, "Droplet.QemuMachine", d.pb.QemuMachine, t.Machine))
|
e := NewChangeEvent(d.pb, "Droplet.QemuMachine", d.pb.QemuMachine, t.Machine)
|
||||||
|
alle = append(alle, e)
|
||||||
d.pb.QemuMachine = t.Machine
|
d.pb.QemuMachine = t.Machine
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,6 +69,7 @@ func NewChangeEvent(d *pb.Droplet, fname string, origval any, newval any) *pb.Ev
|
||||||
e.Droplet = d.Hostname
|
e.Droplet = d.Hostname
|
||||||
e.OrigVal = convertToString(origval)
|
e.OrigVal = convertToString(origval)
|
||||||
e.NewVal = convertToString(newval)
|
e.NewVal = convertToString(newval)
|
||||||
|
e.FieldName = fname
|
||||||
|
|
||||||
// this also works, but it's a bit overkill
|
// this also works, but it's a bit overkill
|
||||||
// e.NewAny = convertToAnypb(newval)
|
// e.NewAny = convertToAnypb(newval)
|
||||||
|
|
16
config.go
16
config.go
|
@ -120,6 +120,22 @@ func writeConfigFile() {
|
||||||
log.Println("config file write error")
|
log.Println("config file write error")
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if me.events.WriteConfigJSON() {
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
|
if me.events.WriteConfigTEXT() {
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
if me.cluster.Droplets.WriteConfigJSON() {
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
|
if me.cluster.Droplets.WriteConfigTEXT() {
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
func writeConfigFileTmp(filename string) bool {
|
func writeConfigFileTmp(filename string) bool {
|
||||||
|
|
Loading…
Reference in New Issue