Issue 716: fix :map-ebs-snapshot-to-device-name

This commit is contained in:
Allen Rohner 2011-10-12 11:29:14 -05:00
parent 0e9d3666ad
commit fe50ae36bc
2 changed files with 8 additions and 2 deletions

View File

@ -399,8 +399,8 @@ See http://code.google.com/p/jclouds for details."
;; aws ec2 options
:map-ephemeral-device-to-device-name])
{:map-ebs-snapshot-to-device-name
(kw-memfn-apply :map-ebs-snapshot-to-device-name
device-name snapshot-id size-in-gib delete-on-termination)
(memfn-apply mapEBSSnapshotToDeviceName
device-name snapshot-id size-in-gib delete-on-termination)
:map-new-volume-to-device-name
(kw-memfn-apply :map-new-volume-to-device-name
device-name size-in-gib delete-on-termination)}))

View File

@ -94,6 +94,12 @@ Ensure the module is on the classpath. You are maybe missing a dependency on
[kw]
(symbol (camelize-mixed kw)))
(defmacro memfn-apply
"Expands into a function that takes one argument,"
[fn-name & args]
`(fn [target# [~@args]]
((memfn ~fn-name ~@args) target# ~@args)))
(defmacro kw-memfn
"Expands into code that creates a function that expects to be passed an
object and any args, and calls the instance method corresponding to