def extract_operational_scripts(st)
      op_scripts = []
      size = st.size
      st.each do |s|
        # Example of s structure
        # ["/api/server_templates/351930003",
        #   {"id"=>351930003,
        #    "name"=>"RightScale Right_Site - 2015q1",
        #    "kind"=>"cm#server_template",
        #    "version"=>5,
        #    "href"=>"/api/server_templates/351930003"} ]
        Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.resource (ST)"
        begin
          tries ||= 3
          temp = Connection.client.resource(s[1]['href'])
          Log.debug "[#{Chimp.get_job_uuid}] API 1.5 call client.resource (ST) complete"
          temp.runnable_bindings.index.each do |x|
            # only add the operational ones
            if x.sequence == 'operational'
              name = x.raw['right_script']['name']
              op_scripts.push([name, x])
            end
          end
        rescue  Exception => e
          Log.error "[#{Chimp.get_job_uuid}] API 1.5 call client.resource (ST) failed (retrying)"
          Log.error "[#{Chimp.get_job_uuid}] #{e.message}"
          sleep 30
          retry unless (tries -= 1).zero?
          Log.error "[#{Chimp.get_job_uuid}] API 1.5 call client.resource (ST) failed (giving up)"
        end
      end

      #We now only have operational runnable_bindings under the script_objects array
      if op_scripts.length < 1
        raise "ERROR: No operational scripts found on the server(s). "
        st.each {|s|
          puts "         (Search performed on server template '#{s[1]['name']}')"
        }
      end
      return op_scripts
    end
def extract_operational_scripts(st)
      op_scripts = []
      size = st.size
      st.each do |s|
        # Example of s structure
        # ["/api/server_templates/351930003",
        #   {"id"=>351930003,
        #    "name"=>"RightScale Right_Site - 2015q1",
        #    "kind"=>"cm#server_template",
        #    "version"=>5,
        #    "href"=>"/api/server_templates/351930003"} ]
        Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.resource (ST)"
        begin
          tries ||= 3
          temp = Connection.client.resource(s[1]['href'])
          Log.debug "[#{Chimp.get_job_uuid}] API 1.5 call client.resource (ST) complete"
          temp.runnable_bindings.index.each do |x|
            # only add the operational ones
            if x.sequence == 'operational'
              name = x.raw['right_script']['name']
              op_scripts.push([name, x])
            end
          end
        rescue  Exception => e
          Log.error "[#{Chimp.get_job_uuid}] API 1.5 call client.resource (ST) failed (retrying)"
          Log.error "[#{Chimp.get_job_uuid}] #{e.message}"
          sleep 30
          retry unless (tries -= 1).zero?
          Log.error "[#{Chimp.get_job_uuid}] API 1.5 call client.resource (ST) failed (giving up)"
        end
      end

      #We now only have operational runnable_bindings under the script_objects array
      if op_scripts.length < 1
        raise "ERROR: No operational scripts found on the server(s). "
        st.each {|s|
          puts "         (Search performed on server template '#{s[1]['name']}')"
        }
      end
      return op_scripts
    end
Returns all matching operational scripts in the st list passed