Merge pull request #810 from hqhq/hq_update_cli

Update cli package
This commit is contained in:
Mrunal Patel
2016-05-20 20:46:59 -07:00
32 changed files with 2259 additions and 306 deletions
+7 -6
View File
@@ -96,10 +96,10 @@ other options are ignored.
Usage: "Total memory usage (memory + swap); set `-1` to enable unlimited swap",
},
},
Action: func(context *cli.Context) {
Action: func(context *cli.Context) error {
container, err := getContainer(context)
if err != nil {
fatal(err)
return err
}
r := specs.Resources{
@@ -135,12 +135,12 @@ other options are ignored.
default:
f, err = os.Open(in)
if err != nil {
fatal(err)
return err
}
}
err = json.NewDecoder(f).Decode(&r)
if err != nil {
fatal(err)
return err
}
} else {
if val := context.Int("blkio-weight"); val != 0 {
@@ -167,7 +167,7 @@ other options are ignored.
var err error
*dest, err = strconv.ParseUint(val, 10, 64)
if err != nil {
fatal(fmt.Errorf("invalid value for %s: %s", opt, err))
return fmt.Errorf("invalid value for %s: %s", opt, err)
}
}
}
@@ -187,7 +187,8 @@ other options are ignored.
config.Cgroups.Resources.MemorySwap = int64(*r.Memory.Swap)
if err := container.Set(config); err != nil {
fatal(err)
return err
}
return nil
},
}