This code looks correct (as patched).  I'd recommend squashing the two
patches together as one commit, because it looks like datasets wouldn't work
with just the first patch.

Also, I think a change of variable names would help clarify how the code
works.  How about this:

if datasets = config["dataset"]
  result[:dataset] = datasets.collect { |dataset| dataset[:name] }

Derek, is this ok with you?  If so we can just push the changes with these
modifications.

On Sat, Nov 27, 2010 at 7:24 PM, Derek Olsen <[email protected]> wrote:

> In zone terminology a dataset refers to a ZFS file system delegated to a
> non-global zone.  This patch allows for the zone provider to natively manage
> datasets and removes the need for an exec to perform the function.
>
> Signed-off-by: Derek Olsen <[email protected]>
> ---
>  lib/puppet/provider/zone/solaris.rb |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/puppet/provider/zone/solaris.rb
> b/lib/puppet/provider/zone/solaris.rb
> index f3c261f..38ac50f 100644
> --- a/lib/puppet/provider/zone/solaris.rb
> +++ b/lib/puppet/provider/zone/solaris.rb
> @@ -221,8 +221,8 @@ Puppet::Type.type(:zone).provide(:solaris) do
>     if dir = config["inherit-pkg-dir"]
>       result[:inherit] = dir.collect { |dirs| dirs[:dir] }
>     end
> -    if dataset = config["dataset"]
> -      result[:dataset] = dataset.collect { |datasets| datasets[:dataset] }
> +    if name = config["dataset"]
> +      result[:dataset] = name.collect { |names| names[:name] }
>     end
>     result[:iptype] = config[:"ip-type"]
>     if net = config["net"]
> --
> 1.7.3.2
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<puppet-dev%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-dev?hl=en.
>
>

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

Reply via email to