-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing AppendConfigItem #8
Comments
Makes sense to me. Let me see what I can do. P.S: Please don't hesitate to report any other problems/inconsistencies/difficulties that you are having with go-lxc. I would like to hear them even if I cannot address them right away. |
By the way forgot to mention, you can achieve the same by just calling SetConfigItem multiple times. package main
import (
"flag"
"log"
"github.com/lxc/go-lxc"
)
var (
lxcpath string
name string
)
func init() {
flag.StringVar(&lxcpath, "lxcpath", lxc.DefaultConfigPath(), "Use specified container path")
flag.StringVar(&name, "name", "rubik", "Name of the container")
flag.Parse()
}
func main() {
c, err := lxc.NewContainer(name, lxcpath)
if err != nil {
log.Fatalf("ERROR: %s\n", err.Error())
}
defer lxc.PutContainer(c)
log.Printf("%s", c.ConfigItem("lxc.cgroup.devices.allow"))
if err := c.SetConfigItem("lxc.cgroup.devices.allow", "b 7:* rwm"); err != nil {
log.Fatalf("ERROR: %s\n", err.Error())
}
log.Printf("%s", c.ConfigItem("lxc.cgroup.devices.allow"))
}
|
@caglar10ur ah didn't realize that. Will do that for now, thanks! |
stgraber
added
Easy
Good for new contributors
Feature
New feature, not a bug
and removed
enhancement
labels
Apr 14, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Per the Python API, there should be an "append_config_item". Without it I can't see a reliable way to set things like lxc.cgroup.devices.allow which accept multiple values.
The text was updated successfully, but these errors were encountered: