Sha256: 1f313ad334c1310bc267187f9bbb5ad5716b04e639773b2e3f44c57db316ddbc
Contents?: true
Size: 1.14 KB
Versions: 5
Compression:
Stored size: 1.14 KB
Contents
require 'chef/knife' module KnifeSpork class SporkEnvironmentCreate < Chef::Knife deps do require 'knife-spork/runner' end banner 'knife spork environment create ENVIRONMENT (options)' option :description, :short => "-d DESC", :long => "--description DESC", :description => "The environment description" def run self.class.send(:include, KnifeSpork::Runner) self.config = Chef::Config.merge!(config) if @name_args.empty? show_usage ui.error("You must specify a environment name") exit 1 end @object_name = @name_args.first run_plugins(:before_environmentcreate) pre_environment = {} environment_create post_environment = load_environment(@object_name) @object_difference = json_diff(pre_environment,post_environment).to_s run_plugins(:after_environmentcreate) end private def environment_create rc = Chef::Knife::EnvironmentCreate.new rc.name_args = @name_args rc.config[:editor] = config[:editor] rc.config[:description] = config[:description] rc.run end end end
Version data entries
5 entries across 5 versions & 1 rubygems