Actually, they do all return arrays, as they all run through munge_name both
in the parse method and in the matchname? method....
def munge_name(name)
# LAK:NOTE http://snurl.com/21zf8 [groups_google_com]
x = name.downcase.split(".").reverse
end
This is why I'm somewhat confused by:
def matchname?(name)
name = munge_name(name) unless @name == :opaque
return true if self.pattern == name
# If it's an exact match, then just return false, since the
# exact didn't match.
if exact?
return false
end
# If every field in the pattern matches, then we consider it
# a match.
pattern.zip(name) do |p,n|
unless p == n
return false
end
end
return true
end
as this looks kind of deliberate for opaque strings, however the second
condition won't ever work as it's testing for equality between an array and
a string.
Also it seems odd that munge_name is being called in the parse method for
each type of value and in the matchname? method itself....
On Thu, Aug 13, 2009 at 1:33 PM, Luke Kanies <[email protected]> wrote:
>
> This looks right; none of the other @pattern assignments use arrays,
> so I don't see why this one should.
>
> On Aug 13, 2009, at 1:11 PM, Nigel Kersten wrote:
>
> > So I am actually planning to make tests for this, I just wanted some
> > wider consensus that this isn't going to break the REST auth system,
> > even though the existing tests run fine.
> >
> >
> >
> > On Thu, Aug 13, 2009 at 1:05 PM, Nigel Kersten <[email protected]>
> > wrote:
> >
> >
> > Signed-off-by: Nigel Kersten <[email protected]>
> > ---
> > lib/puppet/network/authstore.rb | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/lib/puppet/network/authstore.rb b/lib/puppet/network/
> > authstore.rb
> > index 306e1ba..14ddaaf 100755
> > --- a/lib/puppet/network/authstore.rb
> > +++ b/lib/puppet/network/authstore.rb
> > @@ -331,7 +331,7 @@ module Puppet
> > unless value =~ /^[a-za-z0-9][-a-za-z0-...@]*
> > $/
> > raise AuthStoreError, "Invalid pattern
> > %s" % value
> > end
> > - @pattern = [value]
> > + @pattern = value
> > @length = nil # force an exact match
> > @name = :opaque
> > end
> > --
> > 1.6.4
> >
> >
> >
> >
> >
> >
> > --
> > Nigel Kersten
> > [email protected]
> > System Administrator
> > Google, Inc.
> >
> > >
>
>
> --
> I worry that the person who thought up Muzak may be thinking up
> something else. -- Lily Tomlin
> ---------------------------------------------------------------------
> Luke Kanies | http://reductivelabs.com | http://madstop.com
>
>
> >
>
--
Nigel Kersten
[email protected]
System Administrator
Google, Inc.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---