Ok, I think I actually see what might be going on with this, and it requires a 
further change, or at least some investigation. Sorry.

We have been running on the assumption that svccfg changed how it's passing us 
back a list of values, but that's not the case. svccfg will pass back a list of 
values, and if that list was entered as a space delimited list, then we'll see 
the \-escaped spaces. If elements are added singly, the created list should 
come back as space-delimited.

So, possibly the change between previous builds and this breakage has to do 
with the way nscfg is populating the svcprops, I'm not sure.

I believe what this means is that any parsing code needs to handle both types 
of delimiters - which I believe is exactly what the code that Shawn pointed us 
at will do correctly.

This code really shouldn't be one-off calling svcprop and friends anyhow. This 
points to an opportunity to refactor some of this code, but likely that's not a 
great idea in these last few builds for S11.1. 

I suggest making these couple of one-off uses work for parsing both space- and 
backslash-delimited lists in order to address the bug, and that we open an RFE 
for the installadm code to be refactored away from invoking SMF (and possibly 
other) CLIs repeatedly.

Best
Jesse

On May 10, 2012, at 7:44 AM, Nirmal Agarwal wrote:

> Hi Jesse
> 
> Thanks for the review.
> Please find the updated webrev:
> 
> https://cr.opensolaris.org/action/browse/caiman/nirmal27/7166120/webrev/
> 
> Along with _get_nameservers(), I changed _get_domain() which also may face 
> the same issue.
> 
> Regards
> Nirmal
> 
> On 05/09/12 23:59, Jesse Butler wrote:
>> 
>> This looks good to me, but one question. Is svcprop always returning lists 
>> delimited by backslashes now? If so, can you test _get_nameservers() as 
>> well? I think it might need the same treatment.
>> 
>> /jb
>> 
>> On May 8, 2012, at 12:18 PM, Nirmal Agarwal wrote:
>> 
>>> Hi all
>>> 
>>> Can I please get a code review of CR 7166120.
>>> 
>>> 7166120 dhcpd.conf(5) domain-search option incorrectly generated for 
>>> multiple search domains
>>> 
>>> Since there is only 1 line change please find the pdiffs output.
>>> (please let me know if you need webrev, I will create and upload one)
>>> 
>>> bash-4.1$ hg pdiffs
>>> diff -r ff1310effa02 usr/src/cmd/installadm/dhcp.py
>>> --- a/usr/src/cmd/installadm/dhcp.py    Mon May 07 17:32:38 2012 -0700
>>> +++ b/usr/src/cmd/installadm/dhcp.py    Tue May 08 10:24:50 2012 -0600
>>> @@ -1476,7 +1476,7 @@
>>> 
>>>         # return output as a quoted string "example.com","sales.example.com"
>>> 
>>> -        search_domains = p.stdout.strip().split()
>>> +        search_domains = p.stdout.replace('\\','').split()
>>>         return ','.join(['"' + x + '"' for x in search_domains])
>>>     except CalledProcessError:
>>>         logging.debug("Property not set: %s", cmd)
>>> 
>>> 
>>> Testing :
>>> Case mentioned in CR :
>>> 
>>> root@solaris:~# svcprop -p config/search dns/client
>>> in.oracle.com oracle.com\  uk.oracle.com \ sun.com\  \ uk.sun.com\
>>> 
>>> For the above configuration, dhcpd4.conf entry :
>>> option domain-search 
>>> "in.oracle.com","oracle.com","uk.oracle.com","sun.com","uk.sun.com";
>>> 
>>> Thanks
>>> Nirmal
>>> _______________________________________________
>>> 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

Reply via email to