lxc-config/hooks/lib/lxc/registry.rb

16 lines
346 B
Ruby
Raw Normal View History

2015-01-30 08:08:18 +00:00
require "json"
require "pathname"
module Lxc
class Registry
PATH = Pathname.new(File.expand_path("../../../../container.json", __FILE__))
def initialize
@data = JSON.load(File.open(Registry::PATH))
end
attr_accessor :data
def save
Utils.safe_write(Registry::PATH, JSON.pretty_generate(@data))
end
end
end