Add Donut rpc service for sending changes to configuration files

This commit is contained in:
Harshavardhana
2015-07-06 10:35:23 -07:00
parent 57d634da25
commit 1d64e4b6c1
7 changed files with 67 additions and 13 deletions

View File

@@ -106,7 +106,7 @@ func runController(c *cli.Context) {
if err != nil {
Fatalf("Unable to determine current user. Reason: %s\n", err)
}
if len(c.Args()) != 2 || c.Args().First() == "help" {
if len(c.Args()) <= 2 || c.Args().First() == "help" {
cli.ShowCommandHelpAndExit(c, "controller", 1) // last argument is exit code
}
switch c.Args().First() {
@@ -122,5 +122,11 @@ func runController(c *cli.Context) {
Fatalln(err)
}
Println(string(memstats))
case "donut":
hostname, _ := os.Hostname()
err := controller.SetDonut(c.Args().Tail().First(), hostname, c.Args().Tail().Tail())
if err != nil {
Fatalln(err)
}
}
}