Sha256: 8b6eea529f632e2b52c0d50ee3e9657ad1f5fa558b1be3a7840b1003a9726e50
Contents?: true
Size: 1007 Bytes
Versions: 4
Compression:
Stored size: 1007 Bytes
Contents
module KnifeSolo module Tools def system!(command) raise "Failed to launch command #{command}" unless system(command) end def windows_client? RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ end def config_value(key, default = nil) Tools.config_value(config, key, default) end # Chef 10 compatible way of getting correct precedence for command line # and configuration file options. Adds correct handling of `false` values # to the original example in # http://docs.opscode.com/breaking_changes_chef_11.html#knife-configuration-parameter-changes def self.config_value(config, key, default = nil) key = key.to_sym if !config[key].nil? config[key] elsif !Chef::Config[:knife][key].nil? # when Chef 10 support is dropped, this branch can be removed # as Chef 11 automatically merges the values to the `config` hash Chef::Config[:knife][key] else default end end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
knife-solo-0.3.0 | lib/knife-solo/tools.rb |
knife-solo-0.3.0.pre5 | lib/knife-solo/tools.rb |
knife-solo-0.3.0.pre4 | lib/knife-solo/tools.rb |
knife-solo-0.3.0.pre3 | lib/knife-solo/tools.rb |