[PATCH] remove "ExistingBackend" provision backend and 28 other python patches

Noel Power nopower at suse.com
Thu Nov 1 13:11:43 UTC 2018

Hi Douglas

On 01/11/2018 10:05, Noel Power wrote:
> On 31/10/2018 20:57, Douglas Bagnall wrote:
>> On 31/10/18 11:47 PM, Noel Power wrote:
>>>   [PATCH 24/29] python/ms_forest_updates_markdown: avoid implicit
>>>   global variable
>>> -    read_ms_markdown(in_file, out_folder)
>>> +    read_ms_markdown(in_file, out_folder, {})
>>> That looks wrong to me, read_ms_markdown looks like it takes a file or
>>> dictionary, it looks like the code will prefer the file if both are
>>> specified but read_ms_markdown should either pass a temp dict to
>>> save_array routine or save_array should handle the None dict, it should
>>> handle the None default gracefully
>> Right. It just needs the attached version then? I think you are right
>> and it looks clearer.
> RB+

looking at it again, I think we need to be a bit careful, it seems there 
is a possibility that None could get passed to save_array

>                     if filename and out_folder is not None:
>                         save_ldif(filename, result, out_folder)
>                     else:
>                         save_array(guid, result, out_dict)

we pass out_folder and dict to read_ms_markdown but filename is gleaned 
from the input html

so... for the above it is possible that save_array could be called with 
None, maybe this should be an error ?

Or we could always create a temp out_dict at the top of 
read_ms_markdown. I don't think it makes sense to default out_dict in 
save_array (and passing None to save_array *should* be an error and fail 
imo) Thoughts ?


More information about the samba-technical mailing list