               ;; entry-cmd-err-filename below.
               (let [name (-> p .getFileName str)]
                 (if-let [cmd (:command (and (.endsWith name ".json")
-                                            (parse-cmd-filename name)))]
+                                            (q/parse-cmd-filename name)))]
                   (update-metrics (ensure-cmd-metrics metrics registry cmd)
                                   cmd
                                   (Files/size p))

   [puppetlabs.i18n.core :refer [trs]]
   [puppetlabs.kitchensink.core :refer [timestamp]]
   [puppetlabs.puppetdb.nio :refer [copts copt-atomic copt-replace oopts]]
   [puppetlabs.puppetdb.queue :as queue
    :refer [cmdref->entry metadata-str parse-cmd-filename]]
   [puppetlabs.stockpile.queue :as stock])
  (:import
   [java.nio.file AtomicMoveNotSupportedException

  [cmdref stockpile dlo]
  (let [{:keys [path registry metrics]} dlo
        {:keys [command received attempts]} cmdref
        entry (q/cmdref->entry cmdref)
        cmd-dest (.resolve path (entry-cmd-data-filename entry))]
    ;; We're going to assume that our moves will be atomic, and if
    ;; they're not, that we don't care about the possibility of
