Fix "vargant package" for LXC 2.1+ config format
New config format would be under `lxc.rootfs.path` and be prefixed by `dir:`.
This commit is contained in:
parent
a1aa60ded5
commit
2a5510b34c
1 changed files with 6 additions and 6 deletions
|
@ -50,20 +50,20 @@ module Vagrant
|
|||
end
|
||||
|
||||
def rootfs_path
|
||||
config_entry = config_string.match(/^lxc\.rootfs\s+=\s+(.+)$/)[1]
|
||||
case config_entry
|
||||
when /^overlayfs:/
|
||||
pathtype, path = config_string.match(/^lxc\.rootfs(?:\.path)?\s+=\s+(.+:)?(.+)$/)[1..2]
|
||||
case pathtype
|
||||
when 'overlayfs:'
|
||||
# Split on colon (:), ignoring any colon escaped by an escape character ( \ )
|
||||
# Pays attention to when the escape character is itself escaped.
|
||||
fs_type, master_path, overlay_path = config_entry.split(/(?<!\\)(?:\\\\)*:/)
|
||||
_, overlay_path = config_entry.split(/(?<!\\)(?:\\\\)*:/)
|
||||
if overlay_path
|
||||
Pathname.new(overlay_path)
|
||||
else
|
||||
# Malformed: fall back to prior behaviour
|
||||
Pathname.new(config_entry)
|
||||
Pathname.new(path)
|
||||
end
|
||||
else
|
||||
Pathname.new(config_entry)
|
||||
Pathname.new(path)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue