[PATCHES] rename samba_gpoupdate to gpupdate

David Mulder dmulder at suse.com
Thu Jul 12 14:30:39 UTC 2018


Your import should be:

from samba.gpclass import gp_ext

Not:

from gp_class import gp_ext

Otherwise, it looks good. I tested this adding some extensions, and
everything works. I like the cleaner code Douglas. Good work.

On 07/11/2018 07:01 PM, Douglas Bagnall wrote:
> On 12/07/18 01:25, David Mulder via samba-technical wrote:
>> Nice work Douglas, thank you.
>>
>>
>> On 07/10/2018 11:32 PM, Douglas Bagnall wrote:
>>> On 07/07/18 01:57, David Mulder via samba-technical wrote:
>>>  
>>>> Douglas, I'm hoping to get the patches from merge requests 8, 10, and 15
>>>> into 4.9. Merge request 16 can wait. You and Andrew have already
>>>> reviewed 8 and 10, so these are likely ready to merge (and are not
>>>> dependent on 15 or 16 to merge).
>>> OK, I have reviewed 8 and a bit of 10 and re-pushed here:
> RB+ up to "gpo: Add user policy extensions" (aka merge request 10) if 
> we can squash this into "gpo: Dynamically load gp_exts":
>
>
> --- a/python/samba/gp_ext_loader.py
> +++ b/python/samba/gp_ext_loader.py
> @@ -16,6 +16,7 @@
>  
>  import os
>  from samba.gpclass import list_gp_extensions
> +from gp_class import gp_ext
>  
>  try:
>      import importlib.util
> @@ -34,12 +35,10 @@ except ImportError:
>          return imp.load_source(name, location)
>  
>  def get_gp_ext_from_module(name, mod):
> -    import inspect
>      if mod:
> -        clses = inspect.getmembers(mod, inspect.isclass)
> -        for cls in clses:
> -            if cls[-1].__name__ == name:
> -                return cls[-1]
> +        for k, v in vars(mod).items():
> +            if k == name and issubclass(v, gp_ext):
> +                return v
>      return None
>
>
> I think this simplifies and tightens the check and makes it do what it
> says in the commit message.
>
> I'll push that much to another CI build.
>
> Douglas
>

-- 
David Mulder
SUSE Labs Software Engineer - Samba
dmulder at suse.com
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)




More information about the samba-technical mailing list