Class: Zsnap::Config
- Inherits:
-
Object
- Object
- Zsnap::Config
- Defined in:
- lib/zsnap.rb
Instance Attribute Summary collapse
-
#filesystems ⇒ Object
readonly
Returns the value of attribute filesystems.
-
#snapshot_prefix ⇒ Object
readonly
Returns the value of attribute snapshot_prefix.
Instance Method Summary collapse
- #busy_pools ⇒ Object
-
#initialize(value) ⇒ Config
constructor
A new instance of Config.
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
#filesystems ⇒ Object (readonly)
Returns the value of attribute filesystems.
163 164 165 |
# File 'lib/zsnap.rb', line 163 def filesystems @filesystems end |
#snapshot_prefix ⇒ Object (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_pools ⇒ Object
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 |