The commit to simplify the regex used to parse the output from the mount
command on AIX (50c12e55b6f8462f6904ae061e661d1d10c7590a) mis-translated
it.

The original regex was grabbing the 3rd space-separated element, not the
2nd.  This mis-translation caused the provider to grab the device
information instead of the mount point, and compare that to the desired
mount point.  This would cause Puppet to think that the mount was never
actually mounted under normal circumstances.

The code from 50c12e5 was passing the tests because the fixture data did
not include the mandatory leading whitespace that the original regex was
looking for.  The updated fixture data is pulled from the mount manpage
from AIX v6r1.

Reviewed-by: Paul Berry <p...@puppetlabs.com>
Signed-off-by: Jacob Helwig <ja...@puppetlabs.com>
---

Local-branch: tickets/2.6.x/6364-fix-mount-provider-on-aix

 lib/puppet/provider/mount.rb                       |    2 +-
 .../unit/provider/mount/mount-output.aix.txt       |   14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/puppet/provider/mount.rb b/lib/puppet/provider/mount.rb
index c979f74..354ddb1 100644
--- a/lib/puppet/provider/mount.rb
+++ b/lib/puppet/provider/mount.rb
@@ -44,7 +44,7 @@ module Puppet::Provider::Mount
       when "Solaris", "HP-UX"
         line =~ /^#{name} on /
       when "AIX"
-        line.split(/\s+/)[1] == name
+        line.split(/\s+/)[2] == name
       else
         line =~ / on #{name} /
       end
diff --git a/spec/fixtures/unit/provider/mount/mount-output.aix.txt 
b/spec/fixtures/unit/provider/mount/mount-output.aix.txt
index 54edb9c..380dbc5 100644
--- a/spec/fixtures/unit/provider/mount/mount-output.aix.txt
+++ b/spec/fixtures/unit/provider/mount/mount-output.aix.txt
@@ -1,7 +1,7 @@
-/dev/hd4         /                jfs2   Nov 11 12:11 rw,log=/dev/hd8
-/dev/hd2         /usr             jfs2   Nov 11 12:11 rw,log=/dev/hd8
-/dev/hd9var      /var             jfs2   Nov 11 12:11 rw,log=/dev/hd8
-/dev/hd3         /tmp             jfs2   Nov 11 12:11 rw,log=/dev/hd8
-/dev/hd1         /home            jfs2   Nov 11 12:11 rw,log=/dev/hd8
-/proc            /proc            procfs Nov 11 12:11 rw
-/dev/hd10opt     /opt             jfs2   Nov 11 12:11 rw,log=/dev/hd8
+node   mounted          mounted over  vfs    date              options   
+----   -------          ------------ ---  ------------   -------------------
+       /dev/hd0         /            jfs   Dec 17 08:04   rw, log  =/dev/hd8
+       /dev/hd3         /tmp         jfs   Dec 17 08:04   rw, log  =/dev/hd8
+       /dev/hd1         /home        jfs   Dec 17 08:06   rw, log  =/dev/hd8
+       /dev/hd2         /usr         jfs   Dec 17 08:06   rw, log  =/dev/hd8
+sue    /home/local/src  /usr/code    nfs   Dec 17 08:06   ro, log  =/dev/hd8
-- 
1.7.4.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to