lxc / ruby-lxc

ruby bindings for liblxc
https://linuxcontainers.org/lxc
GNU Lesser General Public License v2.1
134 stars 29 forks source link

c.config_item('lxc.mount.entry') sometimes returns a string instead of array #12

Closed jeremiahsnapp closed 10 years ago

jeremiahsnapp commented 10 years ago

I'm not sure if the real problem is in LXC itself or not but c.config_item('lxc.mount.entry') should return an array of strings representing the configured mount entries.

Sometimes it instead returns a string of all the mount entries separated by "\n".

irb(main):015:0> a.config_item('lxc.mount.entry')
=> ["proc proc proc nodev,noexec,nosuid 0 0", "sysfs sys sysfs defaults 0 0", "/sys/fs/fuse/connections sys/fs/fuse/connections none bind,optional 0 0", "/sys/kernel/debug sys/kernel/debug none bind,optional 0 0", "/sys/kernel/security sy
s/kernel/security none bind,optional 0 0", "/sys/fs/pstore sys/fs/pstore none bind,optional 0 0", "/dev-shared dev-shared none bind,optional,create=dir 0 0     ## dev-lxc ##"]
irb(main):016:0> a.config_item('lxc.mount.entry')
=> "proc proc proc nodev,noexec,nosuid 0 0\nsysfs sys sysfs defaults 0 0\n/sys/fs/fuse/connections sys/fs/fuse/connections none bind,optional 0 0\n/sys/kernel/debug sys/kernel/debug none bind,optional 0 0\n/sys/kernel/security sys/kernel/
security none bind,optional 0 0\n/sys/fs/pstore sys/fs/pstore none bind,optional 0 0\n/dev-shared dev-shared none bind,optional,create=dir 0 0     ## dev-lxc ##\n"
jeremiahsnapp commented 10 years ago

See pull request #13

jeremiahsnapp commented 10 years ago

Fixed by fd75ebc9a2541ffcf931d36492534245ca15c102