Dave,
cgi_get_manifests.py - 275 - I don't think running the value through
formatValue() is the right thing to do here for all criteria. For the
memory criteria at least, that function returns a human readable format
(appending " MB" to memory value) which wouldn't seem to be appropriate.
Looking at the existing code, it seems the code at
create_profile.py:394-395 is the closest clue of what we need to do
here. That code read criteria values from the DB (which is, barring the
hex x'mac' value) is equal to what is coming in the postData request at
install time. This code is only calling formatValue() for range
criteria, so perhaps at a minimum, we need to do that here as well.
common_profile.py - 47 - perhaps a comment noting that the values in
this dict are used only to do upfront validation of profiles with variables?
common_profile.py - 91 - If we initialize with this here, we'd
potentially use one of those values from the hard-coded dict as a
replacement value (if the ENV didn't have that criteria var set.) This
could actually happen when the client is older than the server, and is
not sending over some new supported criteria on the server. In such a
case, perhaps it'd be more appropriate to leave whatever wasn't set
un-substituted or blanked, and then allow subsequent validation to fail.
Perhaps make the function assume that whatever substitution values the
caller wants to use are already set in the ENV, and then make
create_profile.py set the ENV with the hard-coded dict before calling
validate_file()?
create_profile.py - 261-307 - These lines can be removed now since we
don't really care to set the criteria passed in from commandline into
the environment anymore.
create_profile.py - 377-401 - Same here.
thanks,
-ethan
On 12/28/11 13:55, Dave Miner wrote:
I'd appreciate review of the changes for
7124655 Profile template expansion should happen at installation time
Webrev is at:
https://cr.opensolaris.org/action/browse/caiman/dminer/slim_7124655/webrev/
This has been tested successfully with both SPARC and x86 clients and
servers, updated unit tests are clean.
Note that this change will require updates to the installadm man page
and the profile docs to reflect the deferred application of templating.
Dave
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss