def lookup_scripts
#TODO fix this so epoch is not hard coded.
puts "WE ARE HARDCODING THE TOOL BOX NAMES TO USE 11H1.b1"
     scripts = [
                 [ 'restore', 'restore and become' ],
                 [ 'slave_init', 'slave init' ],
                 [ 'promote', 'EBS promote to master' ],
                 [ 'backup', 'EBS backup' ],
                 [ 'terminate', 'TERMINATE SERVER' ]
               ]
      ebs_toolbox_scripts = [
                              [ 'create_stripe' , 'EBS stripe volume create - 11H1.b1' ]
                            ]
      mysql_toolbox_scripts = [
                              [ 'create_mysql_ebs_stripe' , 'DB Create MySQL EBS stripe volume - 11H1.b1' ],
                              [ 'create_migrate_script' , 'DB EBS create migrate script from MySQL EBS v1' ]
                            ]
      st = ServerTemplate.find(s_two.server_template_href)
      lookup_scripts_table(st,scripts)
      @scripts_to_run['master_init'] = RightScript.new('href' => "/api/acct/2901/right_scripts/195053")
      #This does not work - does not create the same type as call above does.
      #@scripts_to_run['master_init'] = RightScript.find_by("name") { |n| n =~ /DB register master \-ONLY FOR TESTING/ }
      raise "Did not find script" unless @scripts_to_run['master_init']

      tbx = ServerTemplate.find_by(:nickname) { |n| n =~ /EBS Stripe Toolbox - 11H1.b1/ }
      raise "Did not find toolbox template" unless tbx[0]
      # Use the HEAD revision.
      lookup_scripts_table(tbx[0],ebs_toolbox_scripts)
#      @scripts_to_run['create_stripe'] = RightScript.new('href' => "/api/acct/2901/right_scripts/198381")
#TODO - does not account for 5.0/5.1 toolbox differences
puts "USING MySQL 5.0 toolbox"
      tbx = ServerTemplate.find_by(:nickname) { |n| n =~ /Database Manager with MySQL 5.0 Toolbox - 11H1.b1/ }
      raise "Did not find toolbox template" unless tbx[0]
      lookup_scripts_table(tbx[0],mysql_toolbox_scripts)
#      @scripts_to_run['create_mysql_ebs_stripe'] = RightScript.new('href' => "/api/acct/2901/right_scripts/212492")
#      @scripts_to_run['create_migrate_script'] = tbx[0].executables.detect { |ex| ex.name =~ /DB EBS create migrate script from MySQL EBS v1 master/ }
     raise "FATAL: Need 2 MySQL servers in the deployment" unless @servers.size == 2
    end
def lookup_scripts
#TODO fix this so epoch is not hard coded.
puts "WE ARE HARDCODING THE TOOL BOX NAMES TO USE 11H1.b1"
     scripts = [
                 [ 'restore', 'restore and become' ],
                 [ 'slave_init', 'slave init' ],
                 [ 'promote', 'EBS promote to master' ],
                 [ 'backup', 'EBS backup' ],
                 [ 'terminate', 'TERMINATE SERVER' ]
               ]
      ebs_toolbox_scripts = [
                              [ 'create_stripe' , 'EBS stripe volume create - 11H1.b1' ]
                            ]
      mysql_toolbox_scripts = [
                              [ 'create_mysql_ebs_stripe' , 'DB Create MySQL EBS stripe volume - 11H1.b1' ],
                              [ 'create_migrate_script' , 'DB EBS create migrate script from MySQL EBS v1' ]
                            ]
      st = ServerTemplate.find(s_two.server_template_href)
      lookup_scripts_table(st,scripts)
      @scripts_to_run['master_init'] = RightScript.new('href' => "/api/acct/2901/right_scripts/195053")
      #This does not work - does not create the same type as call above does.
      #@scripts_to_run['master_init'] = RightScript.find_by("name") { |n| n =~ /DB register master \-ONLY FOR TESTING/ }
      raise "Did not find script" unless @scripts_to_run['master_init']

      tbx = ServerTemplate.find_by(:nickname) { |n| n =~ /EBS Stripe Toolbox - 11H1.b1/ }
      raise "Did not find toolbox template" unless tbx[0]
      # Use the HEAD revision.
      lookup_scripts_table(tbx[0],ebs_toolbox_scripts)
#      @scripts_to_run['create_stripe'] = RightScript.new('href' => "/api/acct/2901/right_scripts/198381")
#TODO - does not account for 5.0/5.1 toolbox differences
puts "USING MySQL 5.0 toolbox"
      tbx = ServerTemplate.find_by(:nickname) { |n| n =~ /Database Manager with MySQL 5.0 Toolbox - 11H1.b1/ }
      raise "Did not find toolbox template" unless tbx[0]
      lookup_scripts_table(tbx[0],mysql_toolbox_scripts)
#      @scripts_to_run['create_mysql_ebs_stripe'] = RightScript.new('href' => "/api/acct/2901/right_scripts/212492")
#      @scripts_to_run['create_migrate_script'] = tbx[0].executables.detect { |ex| ex.name =~ /DB EBS create migrate script from MySQL EBS v1 master/ }
     raise "FATAL: Need 2 MySQL servers in the deployment" unless @servers.size == 2
    end
lookup all the RightScripts that we will want to run