Drew,
I have a follow up question about the SRC issue (see below).
I am fine with the other responses.
Thanks,
John
On Aug 11, 2011, at 10:22 AM, Drew Fisher wrote:
>
>
> On 8/11/11 10:37 AM, John Fischer wrote:
>>
>> Drew,
>>
>> Good work here. I didn't know about the stderr/stdout usage of StringIO()
>> trick. I did that differently. Cool. Comments below.
>>
>> Thanks,
>>
>> John
>>
>> usr/src/tools/tests/slim_regression_test.py
>> --------------------------------------------------------------------------------------------
>> 1. Would it be better to put these tests within the main function?
>> 38 try:
>> 39 SRC = os.environ["SRC"]
>> 40 except KeyError:
>> 41 print "unable to find $SRC in environment. Please add SRC to "
>> 42 print "/etc/sudoers file under the 'Defaults env_keep=...' section"
>> 43
>> 44 # check permissions
>> 45 if os.geteuid() != 0:
>> 46 raise SystemExit("Error: Root privileges are required")
>> 47
>
> I have to leave the SRC check in the global scope so that optparse can set up
> the usage correctly. I could move the permissions check into main(), but if
> I'm going to bomb out of the script for a missing environment variable, I
> might as well do the same for invalid permissions.
Are you bombing out if SRC is not in the environment? The way that I
parse the code here is that you are printing the messages and then continuing
to the permissions check.
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss