Sha256: 946d256021c112e4b87418f6daaad8e682c4440abf5ba108cdb0782943c76857

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

module Kakine
  class CLI < Thor

    option :tenant, type: :string, aliases: '-t'
    desc 'show', 'show Security Groups specified tenant'
    def show
      setup(options)
      Kakine::Director.show_current_security_group
    end

    option :tenant, type: :string, aliases: "-t"
    option :dryrun, type: :boolean, aliases: "-d"
    option :filename, type: :string, aliases: "-f"
    desc 'apply', "apply local configuration into OpenStack"
    def apply
      setup(options)
      Kakine::Director.apply
    end

    option :tenant, type: :string, aliases: "-t"
    option :filename, type: :string, aliases: "-f"
    option :format, type: :string, aliases: '-F'
    option :output, type: :string, aliases: '-o'
    desc 'convert', 'convert Security Groups into other format'
    def convert
      format = options[:format] or fail '--format is required'
      output = options[:output]
      Kakine::Option.set_options(options)
      Kakine::Director.convert(format, output)
    end

    no_commands do
      def setup(options)
        Kakine::Option.set_options(options)
        Kakine::Config.setup unless ENV['RACK_ENV'] == 'test'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kakine-0.7.0 lib/kakine/cli.rb
kakine-0.6.5 lib/kakine/cli.rb
kakine-0.6.4 lib/kakine/cli.rb