puppetlabs/puppet — pull request #1547 by MosesMendoza (2013-03-22 20:30:59+00:00)
Title: Add support for comment attribute in aix user provider

The AIX user attribute "gecos" maps to "comment", similar to how the useradd
provider manages this. This commit adds a "gecos" => "comment" mapping in the
provider so that comment is one of the aix user attributes we can manage. A
difficulty arises though because the "gecos" attribute can legally contain both
"=" characters and spaces. Currently the output of lsuser cmd, which we use to
retrieve user attributes, is parsed using AixObject#parse_attr_list. This
parses the AIX space-separated attribute list output format. When the value for
"gecos" contains spaces, this breaks by returning only the first of the
delimited tokens, e.g. "comment => John" when "John Doe" is the comment. This
commit adds the "-c" flag to the lsuser call, which tells AIX to format the
output in colon-delimited format. This switches the parsing to using the
AixObject#parse_colon_list, which returns the output of the "gecos" value
correctly, because ":" is not a legal value (gecos internal values are
separated by ";"). This commit also removes commented out getter/setter section
for "comment" since we're not using it. This PR resolves failing tests in
the pe_acceptance_tests, specifically resource/user/should_modify.

Signed-off-by: Moses Mendoza