diff options
| author | Jeff Carr <[email protected]> | 2024-10-23 02:56:55 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-23 02:56:55 -0500 |
| commit | 09b635219ac8d9b6d7a8a44eab44516cc1ebc9ee (patch) | |
| tree | 80fc59a5c912e4dd0fe95121d09b89097644a850 /main.go | |
| parent | 3f2cbcb57f818981b1291c0e644b6e3416b7d455 (diff) | |
compiles and runs. logic wrong
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 35 |
1 files changed, 29 insertions, 6 deletions
@@ -35,17 +35,40 @@ func main() { log.DaemonMode(true) } + // set defaults + me.unstable = time.Now() // initialize the grid as unstable + me.delay = 5 * time.Second // how often to poll the hypervisors + me.changed = false + cfgfile() + var ok bool = true for _, filename := range argv.Xml { log.Info("add xml file", filename) + domcfg, err := readXml(filename) + if err != nil { + log.Info("error:", filename, err) + ok = false + continue + } + d, err := addDroplet(domcfg) + if err != nil { + ok = false + } + if d == nil { + log.Info("addDroplet() returned nil") + ok = false + } + } + if me.changed { + writeConfigFile() + writeConfigFileDroplets() + os.Exit(0) + } + if !ok { + log.Info("adding xml files failed") + os.Exit(-1) } - - // initialize the grid as unstable - me.unstable = time.Now() - - // how often to poll the hypervisors - me.delay = 5 * time.Second /* log.Info("command line hypervisors:", argv.Hosts) |
