From 085e3e3dcb52a3b9e2293a06cb1315ae0fe58fbc Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Sat, 2 Sep 2017 12:27:36 -0700 Subject: [PATCH] Fix modules endpoint of file_metadatas API This patch fixes a couple of typos that prevented the "/modules" endpoint of the file_metadatas API from working correctly. --- .../puppetlabs/services/file_serving/file_serving_core.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/clj/puppetlabs/services/file_serving/file_serving_core.clj b/src/clj/puppetlabs/services/file_serving/file_serving_core.clj index 3c11857..24c02d5 100644 --- a/src/clj/puppetlabs/services/file_serving/file_serving_core.clj +++ b/src/clj/puppetlabs/services/file_serving/file_serving_core.clj @@ -364,7 +364,7 @@ module (get-in request [:route-params :module]) path (get-in request [:route-params :path]) modulepath (get-in @(:environments context) [environment "modulepath"]) - root (str module "/files") + root (find-in-modulepath modulepath module "/files") ;; FIXME: Only allowed values are "manage" and "follow". There's ;; also a "source_permissions" parameter documented, but that ;; seems to be a docs bug since the param isn't actually used @@ -414,12 +414,12 @@ (defn file-metadatas-handler [context] - (let [module-handler (module-metadata-handler context) + (let [module-handler (module-metadatas-handler context) plugin-handler (plugin-metadatas-handler context "lib") pluginfact-handler (plugin-metadatas-handler context "facts.d")] (-> (comidi/routes (comidi/context "/puppet/v3/file_metadatas" - (comidi/GET ["/modules" [#"[a-z][a-z0-9_]*" :module] [#".*" :path]] request + (comidi/GET ["/modules/" [#"[a-z][a-z0-9_]*" :module] [#".*" :path]] request (module-handler request)) (comidi/GET ["/plugins" [#".*" :path]] request (plugin-handler request))