Class: Zsnap::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/zsnap.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Config

Returns a new instance of Config.



165
166
167
168
169
# File 'lib/zsnap.rb', line 165

def initialize(value)
  @snapshot_prefix = value['snapshot_prefix']
  @filesystems = value['filesystems'].map { |key, val| FSInfo.new(key, val) }
  @pools = @filesystems.map { |fs| fs.pool }.uniq
end

Instance Attribute Details

#filesystemsObject (readonly)

Returns the value of attribute filesystems.



163
164
165
# File 'lib/zsnap.rb', line 163

def filesystems
  @filesystems
end

#snapshot_prefixObject (readonly)

Returns the value of attribute snapshot_prefix.



163
164
165
# File 'lib/zsnap.rb', line 163

def snapshot_prefix
  @snapshot_prefix
end

Instance Method Details

#busy_poolsObject



171
172
173
174
175
# File 'lib/zsnap.rb', line 171

def busy_pools
  @busy_pools ||= @pools.select do |pool|
    `zpool status #{pool}`.any? { |line| line =~ /(scrub|resilver) in progress/ }
  end
end