lib/kakine/cli.rb in kakine-0.4.0 vs lib/kakine/cli.rb in kakine-0.5.0
- old
+ new
@@ -1,22 +1,27 @@
-require 'kakine'
-
module Kakine
class CLI < Thor
option :tenant, type: :string, aliases: '-t'
desc 'show', 'show Security Groups specified tenant'
def show
- Kakine::Option.set_options(options)
+ 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
- Kakine::Option.set_options(options)
+ setup(options)
Kakine::Director.apply
+ end
+
+ no_commands do
+ def setup(options)
+ Kakine::Option.set_options(options)
+ Kakine::Config.setup unless ENV['RACK_ENV'] == 'test'
+ end
end
end
end