Method: Specinfra::Command::Module::Zfs#check_has_property

Defined in:
lib/specinfra/command/module/zfs.rb

#check_has_property(zfs, property = nil) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/specinfra/command/module/zfs.rb', line 9

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