Danek Duvall wrote:
The webrev at

    http://cr.opensolaris.org/~dduvall/pkg-userverify/

has fixes for

    5149 ftpuser part of user actions seems broken
    12951 pkg verify fails to complain if a user is missing.

which should help a little in having "pkg verify" be clean out of the box.
I think all the issues with ftpuser have been rooted out, and pkg verify
for a user now complains correctly when things are off.  And I've added a
bunch of test cases to ensure the behavior stays the same.

Bart's eyes probably need to be on this, but I'd be happy to have anyone's
review.

This looks fine to me... but I tried to find a more elegant fix for the
verify routine in user.py, though, as the logic has gotten somewhat
convoluted.

There are three classes of attributes in play here:

1) those that are specified in the original action
2) those that have a default value
3) those that are dynamically created

We can check 1) and 2), but not 3).

current_attributes is the union of all three.
pwderfval is 2)
1) is self.attr.

so:
       pwdefval["ftpuser"] = "true"
       should_be = pwdefval.copy().update(self.attrs)
       # enable check for missing attrs
       for k in should_be:
           cur_attrs.setdefault(k, "<missing>")

       return [
       "%s: '%s' should be '%s'" % (a, cur_attrs[a], should_be[a])
       for a in should_be.keys()
       if cur_attrs[a] != should_be[a]
       ]


--
Bart Smaalders                  Solaris Kernel Performance
[email protected]         http://blogs.sun.com/barts
"You will contribute more with mercurial than with thunderbird."
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to