 
 (def PoolDefinition
   {:environment schema/Str
-   :size schema/Int})
+   (schema/optional-key :size) schema/Int})
 
 (def PoolConfig
   "Schema defining the config map for the JRubyPuppet pooling functions.

           (clojure.lang Atom))
  (:require [clojure.tools.logging :as log]
            [me.raynes.fs :as fs]
            [schema.core :as schema]))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Definitions

(def illegal-env-names
  "These environment names are not allowed by Puppet."

  create-pool-from-config :- PoolData
  "Create a new PoolData based on the config input."
  [{:keys [environment size]} :- PoolDefinition]
  (let [size (if size size
                      default-pool-size)]
    {:environment  (keyword environment)
     :pool         (instantiate-free-pool size)
     :size         size
     :initialized? false}))

(schema/defn ^:always-validate
  add-pool-from-config :- PoolsMap
