On 5/2/12 12:48 AM, Karen Tung wrote:
Hi Drew,
On 05/ 1/12 07:07 AM, Drew Fisher wrote:
name can never be None because of the code in can_handle:
if element.get(cls.NAME_LABEL) is None:
return False
Good catch on the empty spaces. I'll toss a strip() call in there:
if not name.strip():
raise ...
Is "my test distro" a valid name? If so, a simple name.strip() will
remove the spaces.
If that's not a valid name, should we check for that as well?
"my test distro" is a valid name. I just tested running a full DC run
with that as the distro name:
<snip>
08:37:38 === Executing Create ISO Checkpoint ==
08:37:38 Making final ISO image: /rpool/cr_7163019/dc/ai/media/my
test distro.iso
08:37:53 === Executing Create USB Checkpoint ===
08:37:53 Making final USB image: /rpool/cr_7163019/dc/ai/media/my
test distro.usb
<snip>
[mox:src] > ls -lh /rpool/cr_7163019/dc/ai/media/my\ test\ distro.*
-rw-r--r-- 1 root root 302M May 2 08:37
/rpool/cr_7163019/dc/ai/media/my test distro.iso
-r--r--r-- 1 root root 363M May 2 08:38
/rpool/cr_7163019/dc/ai/media/my test distro.usb
Also, str.strip() only removes whitespace from either end of the
string. It does not remove whitespace in the middle. I've added a
second test to this CR which tests an entire string of random whitespace
to test the strip() call.
Newest webrev is here and contains fixes from Dermot and Jack comments:
https://cr.opensolaris.org/action/browse/caiman/drewfish/7163019_2/webrev/
-Drew
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss