lib/kpm/tasks.rb in kpm-0.6.2 vs lib/kpm/tasks.rb in kpm-0.6.3

- old
+ new

@@ -491,11 +491,11 @@ :default => nil, :desc => 'Database Host name' method_option :database_port, :type => :string, :default => nil, - :desc => 'Database Host name' + :desc => 'Database port' desc 'account', 'export/import accounts' def account logger.info 'Please wait processing the request!!!' begin config_file = nil @@ -548,11 +548,11 @@ if not e.is_a?(Interrupt) logger.error e.backtrace.join("\n") end end end - + method_option :key_prefix, :type => :string, :default => nil, :enum => KPM::TenantConfig::KEY_PREFIXES, :desc => 'Retrieve a per tenant key value based on key prefix' @@ -570,11 +570,11 @@ :desc => 'Killbill URL ex. http://127.0.0.1:8080' desc 'tenant_config', 'export all tenant-level configs.' def tenant_config logger.info 'Please wait processing the request!!!' begin - + if options[:killbill_url] && /https?:\/\/[\S]+/.match(options[:killbill_url]).nil? raise Interrupt,'--killbill_url, required format -> http(s)://something' end if options[:killbill_api_credentials] && options[:killbill_api_credentials].size != 2 @@ -582,18 +582,18 @@ end if options[:killbill_credentials] && options[:killbill_credentials].size != 2 raise Interrupt,'--killbill_credentials, required format -> <user> <password>' end - + if options[:key_prefix] === :key_prefix.to_s raise Interrupt, "--key_prefix, posible values #{KPM::TenantConfig::KEY_PREFIXES.join(', ')}" end tenantConfig = KPM::TenantConfig.new(options[:killbill_api_credentials],options[:killbill_credentials], options[:killbill_url], logger) - + tenantConfig.export(options[:key_prefix]) rescue Exception => e logger.error "\e[91;1m#{e.message}\e[0m" if not e.is_a?(Interrupt) @@ -637,10 +637,14 @@ :desc => 'DB credentials <user> <password>' method_option :database_host, :type => :string, :default => nil, :desc => 'Database Host name' + method_option :database_port, + :type => :string, + :default => nil, + :desc => 'Database port' method_option :kaui_web_path, :type => :string, :default => nil, :desc => 'Path for the KAUI web app' method_option :killbill_web_path, @@ -687,10 +691,10 @@ raise Interrupt,'--killbill_web_path, please provide a valid killbill web path' end diagnostic = KPM::DiagnosticFile.new(options[:config_file],options[:killbill_api_credentials],options[:killbill_credentials], options[:killbill_url],options[:database_name],options[:database_credentials], - options[:database_host], options[:kaui_web_path], options[:killbill_web_path], options[:bundles_dir],logger) + options[:database_host], options[:database_port], options[:kaui_web_path], options[:killbill_web_path], options[:bundles_dir],logger) diagnostic.export_data(options[:account_export], options[:log_dir]) rescue Exception => e logger.error "\e[91;1m#{e.message}\e[0m" if not e.is_a?(Interrupt)