                                      row-callback-fn)))
 
   (clean [this] (clean this #{}))
-  (clean [this what] (clean-puppetdb (service-context this) (get-config) what))
+  (clean [this what] (clean-puppetdb (service-context this) what))
 
   (delete-node [this certname]
                (delete-node-from-puppetdb (service-context this) certname))

                     :q q
                     :scf-read-db read-db
                     :scf-write-dbs write-db-pools
                     :scf-write-db-names write-db-names}))))))

(defn db-unsupported-msg

(defn- clean-puppetdb
  "Implements the PuppetDBServer clean method, see the protocol for
  further information."
  [context what]
  ;; For now, just serialize them.
  ;; FIXME: improve request results wrt multiple databases?
  (let [lock (:clean-lock context)]
    (when (.tryLock lock)
      (try
        (loop [[db & dbs] (get-in context [:shared-globals :scf-write-dbs])
               [cfg & cfgs] (get-in context [:shared-globals :scf-write-db-cfgs])
               ex nil]
          (if-not db
            (if-not ex
              true
              (throw ex))
            (let [ex (try
                       (clean-up db lock cfg what)
                       ex
                       (catch Exception db-ex
                         (when ex (.addSuppressed ex db-ex))
                         (or ex db-ex)))]
              (recur dbs cfgs ex))))
        (finally
          (.unlock lock))))))

