
16 Oct
2008
16 Oct
'08
10:13 p.m.
Deepti B Kalakeri wrote: > > > Kaitlin Rupert wrote: >>> - - if len(ccn_list) != len(valid_services): >>> - logger.error("'%s' returned %d, expected %d", >>> - an, len(valid_services), len(ccn_list)) >>> + >>> + ccn_list = Set(ccn_list) + + if (len(val_serv) - >>> len(ccn_list)) != 0: >>> + if host_ccn == 'Linux_ComputerSystem': >>> + return XFAIL_RC(bug_sblim) >> >> I'm not sure I understand the usage of Sets here.. >> >> if len(ccn_list) != len(valid_services): >> >> Seems like the above would accomplish the same thing. The usage of >> Sets isn't wrong.. but I'm not sure I see the need to use them in this >> case. > Oops! sorry this should have been if len((val_serv) - (ccn_list)) !=0. > I am trying to achieve 2 things > 1) Compare the len > 2) Verify if the values are all similar. Ah, good point here. I always forget that Sets will check the elements as well as the length. Definitely a good point here. I had no other comments, so I'll apply this. Thanks! > > We can use if len(ccn_list) != len(valid_services), but this will only > verify the length but will not compare the elements of the list. > I hope its ok to use if len((val_serv) - (ccn_list)) !=0, if you have > any better solutions, let me know. > -- Kaitlin Rupert IBM Linux Technology Center kaitlin@linux.vnet.ibm.com