Module: SingleServiceScript
- Included in:
- MySQLServiceScript, OfflineSingleServiceScript
- Defined in:
- lib/tungsten/script.rb
Overview
Require the script to specify a default replication service. If there is a single replication service, that will be used as the default. If there are multiple, the user must specify –service.
Instance Method Summary collapse
Instance Method Details
#configure ⇒ Object
570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 |
# File 'lib/tungsten/script.rb', line 570 def configure super() if TI if TI.replication_services.size() > 1 default_service = nil else default_service = TI.default_dataservice() end add_option(:service, { :on => "--service String", :help => "Replication service to read information from", :default => default_service }) end end |
#validate ⇒ Object
588 589 590 591 592 593 594 595 596 597 598 599 600 |
# File 'lib/tungsten/script.rb', line 588 def validate super() if @options[:service] == nil TU.error("You must specify a dataservice for this command with the --service argument") else if TI unless TI.replication_services().include?(@options[:service]) TU.error("The #{@options[:service]} service was not found in the replicator at #{TI.hostname()}:#{TI.root()}") end end end end |