lib/specinfra/command/module/zfs.rb in specinfra-2.25.1 vs lib/specinfra/command/module/zfs.rb in specinfra-2.26.0

- old
+ new

@@ -1,18 +1,25 @@ -module Specinfra::Command::Module::Zfs - def check_exists(zfs) - "zfs list -H #{escape(zfs)}" - end +module Specinfra + module Command + module Module + module Zfs + def check_exists(zfs) + "zfs list -H #{escape(zfs)}" + end - 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)}" + 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 + + def get_property(zfs) + "zfs get -Hp -o property,value all #{escape(zfs)}" + end + end end - commands.join(' && ') end - - def get_property(zfs) - "zfs get -Hp -o property,value all #{escape(zfs)}" - end end +