Module: Specinfra::Command::Module::Zfs
- Included in:
- Linux::Base::Zfs, Solaris::Base::Zfs
- Defined in:
- lib/specinfra/command/module/zfs.rb
Instance Method Summary collapse
Instance Method Details
#check_exists(zfs) ⇒ Object
2 3 4 |
# File 'lib/specinfra/command/module/zfs.rb', line 2 def check_exists(zfs) "zfs list -H #{escape(zfs)}" end |
#check_has_property(zfs, property = nil) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/specinfra/command/module/zfs.rb', line 6 def check_has_property(zfs, property=nil) commands = [] property.sort.each do |key, value| regexp = "^#{value}$" commands << "zfs list -H -o #{escape(key)} #{escape(zfs)} | grep -- #{escape(regexp)}" end commands.join(' && ') end |