Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

When volumes are mounted, the node[:filesystem] is not updated. This …

…means the volume is not considered `.mounted?`, leading to the resize recipe never working the first time around. Added a kludge that forces the volume to be considered mounted once the mount porcess completes.
  • Loading branch information...
commit df215c7de60b597d3cea44232072fa40484f4edf 1 parent c56c567
Philip (flip) Kromer mrflip authored
5 cookbooks/volumes/libraries/simple_volume.rb
View
@@ -34,6 +34,7 @@ def attached?
# True if the volume is mounted
def mounted?
+ return true if self[:mounted]
!!( attached? && mount_point && File.exists?(mount_point) && current[:mount] == mount_point )
end
@@ -103,6 +104,10 @@ def current
curr
end
+ def mounted!
+ self[:mounted] = true
+ end
+
# volume was resized, so mark it as no longer needing resize
def resized!
self[:resized] = true
2  cookbooks/volumes/recipes/mount.rb
View
@@ -57,4 +57,6 @@
make_dir_rsrc.run_action(:create)
vol_mount_rsrc.run_action(:mount)
+ # KLUDGE: tell subsequent actions the volume is mounted (the node metadata is now out of date)
+ vol.mounted!
end
Please sign in to comment.
Something went wrong with that request. Please try again.