<commit_before>(ns circle.backend.action.load-balancer
  (:import com.amazonaws.AmazonClientException)
  (:require [circle.backend.nodes :as nodes])
  (:use [circle.backend.action :only (defaction abort!)])
  (:use [circle.util.except :only (throw-if-not)])
  (:use [circle.backend.build :only (build-log)])
  (:use [robert.bruce :only (try-try-again)])
  (:require [circle.backend.load-balancer :as lb])
  (:require [circle.backend.ec2 :as ec2]))

(defaction add-instances []
  {:name "add to load balancer"}
  (fn [build]
    (try
      (let [lb-name (-> @build :lb-name)
            instance-ids (-> @build :instance-ids)
            _ (doseq [i instance-ids
                      :let [az (ec2/get-availability-zone i)]]
                (lb/ensure-availability-zone lb-name az))
            result (lb/add-instances lb-name instance-ids)]
        (build-log "added %s to load balancer %s successful" instance-ids lb-name))
      (catch AmazonClientException e
        (println "add-instances:" e)
        {:success false
         :continue false
         :err (.getMessage e)}))))
<commit_msg>Fix printing of instances in the load balancer action<commit_after>(ns circle.backend.action.load-balancer
  (:import com.amazonaws.AmazonClientException)
  (:require [circle.backend.nodes :as nodes])
  (:use [circle.backend.action :only (defaction abort!)])
  (:use [circle.util.except :only (throw-if-not)])
  (:use [circle.backend.build :only (build-log)])
  (:use [robert.bruce :only (try-try-again)])
  (:require [circle.backend.load-balancer :as lb])
  (:require [circle.backend.ec2 :as ec2]))

(defaction add-instances []
  {:name "add to load balancer"}
  (fn [build]
    (try
      (let [lb-name (-> @build :lb-name)
            instance-ids (-> @build :instance-ids)
            _ (doseq [i instance-ids
                      :let [az (ec2/get-availability-zone i)]]
                (lb/ensure-availability-zone lb-name az))
            result (lb/add-instances lb-name instance-ids)]
        (build-log "added %s to load balancer %s successful" (str/join ", " instance-ids) lb-name))
      (catch AmazonClientException e
        (println "add-instances:" e)
        {:success false
         :continue false
         :err (.getMessage e)}))))

{'fraction_non_alphanumeric': 0.1537777777777778, 'fraction_numerical': 0.0026666666666666666, 'mean_word_length': 2.7579298831385644, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4881947', 'n_tokens_mistral': 737, 'n_tokens_neox': 710, 'n_words': 183}