Sha256: b102d60d908797c1b112937eaa3ead8739150da8c8d81c80d05c892ceaef3be3

Contents?: true

Size: 1.69 KB

Versions: 5

Compression:

Stored size: 1.69 KB

Contents

#
# Author:: Philip (flip) Kromer (<flip@infochimps.com>)
# Copyright:: Copyright (c) 2011 Infochimps, Inc
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require File.expand_path(File.dirname(__FILE__)+"/knife_common.rb")

class Chef
  class Knife
    class ClusterShow < Knife
      include ClusterChef::KnifeCommon
      deps do
        ClusterChef::KnifeCommon.load_deps
      end

      banner "knife cluster show CLUSTER_NAME [FACET_NAME [INDEXES]] (options)"

      def run
        load_cluster_chef
        die(banner) if @name_args.empty?
        configure_dry_run

        # Load the cluster/facet/slice/whatever
        target = get_slice(* @name_args)

        #
        # Dump entire contents of objects if -VV flag given
        #
        if config[:verbosity] >= 2
          target.each do |svr|
            Chef::Log.debug( "Server #{svr.name}: #{JSON.pretty_generate(svr.to_hash)}" )
            Chef::Log.debug( "- cloud: #{JSON.pretty_generate(svr.cloud.to_hash)}" )
            Chef::Log.debug( "- fog:   #{JSON.pretty_generate(svr.fog_description_for_launch)}" )
          end
        end

        # Display same
        display(target)

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cluster_chef-knife-3.0.9 lib/chef/knife/cluster_show.rb
cluster_chef-knife-3.0.8 lib/chef/knife/cluster_show.rb
cluster_chef-knife-3.0.7 lib/chef/knife/cluster_show.rb
cluster_chef-knife-3.0.6 lib/chef/knife/cluster_show.rb
cluster_chef-knife-3.0.5 lib/chef/knife/cluster_show.rb