Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With new ruby (1.9.3) and puppet (3.2) the module does not work #1

Closed
onyxmaster opened this issue May 23, 2013 · 4 comments
Closed

Comments

@onyxmaster
Copy link

Attaching patch that fixed it for me: The first change is harmless, the second one is backwards incompatible.

--- lib/puppet/provider/net_share/net_share.rb  2013-05-23 15:40:04.000000000 +0400
+++ lib/puppet/provider/net_share/net_share.rb  2013-05-23 15:47:07.000000000 +0400
@@ -73,7 +73,7 @@

     properties[:ensure] = :present

-    output.each do |line|
+    output.each_line do |line|
       break if line.rstrip.length == 0

       last_name = name
--- lib/puppet/type/net_share.rb    2013-05-23 15:40:04.000000000 +0400
+++ lib/puppet/type/net_share.rb    2013-05-23 15:47:07.000000000 +0400
@@ -51,10 +51,8 @@
     desc "An array of permissions. Example: ['computer\\user,full', 'computer\\user2,change', 'computer\\user3,read']"

     munge do |value|
-      value.collect do |item|
-        user, access = item.split(',', 2)
-        "#{user.strip},#{access.strip.downcase}"
-      end
+      user, access = value.split(',', 2)
+      "#{user.strip},#{access.strip.downcase}"
     end
   end
@nibalizer
Copy link

@simondean Have you reviewed the patch? Confirm/denied the bug?

@onyxmaster Maybe submit the patch as a github pull request?

johnburns320 referenced this issue in johnburns320/puppet-net_share Jan 13, 2014
Ruby 1.9.3 no longer provides an each method for String objects.
Switching to use each_line method.

@onyxmaster submitted Issue #1 providing original fix.
johnburns320 referenced this issue in johnburns320/puppet-net_share Jan 13, 2014
Permissions property on the net_share type was trying to munge an array
of values using a collect method deprecated in Puppet 3.x.

Changed munge block on permissions property to treat each value as a
string.

@onyxmaster submitted Issue #1 providing original fix.
@Cylindric
Copy link

Aah, thank you! I was getting errors until I found this patch :)

Munging failed for value "computername\\username,full" in class permissions: undefined method `collect' for "computername\\username,full":String

@TerribleDev
Copy link

👍

peterbeck added a commit to peterbeck/puppet-net_share that referenced this issue May 7, 2016
@onyxmaster
Copy link
Author

Looks like this is never going to be fixed in this repo, well there are other forks =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants