From: Rob van der Linde Date: Mon, 25 Mar 2024 19:29:24 +0000 (+1300) Subject: python: domain: models: MODELS lookup does need to include base Model for shell command X-Git-Tag: tdb-1.4.11~1343 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfd1f8cd467d081eac4dbdd3bd0e90ca1a7de1a0;p=thirdparty%2Fsamba.git python: domain: models: MODELS lookup does need to include base Model for shell command Signed-off-by: Rob van der Linde Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/domain/models/model.py b/python/samba/domain/models/model.py index d14a87f6a48..3671eaf367b 100644 --- a/python/samba/domain/models/model.py +++ b/python/samba/domain/models/model.py @@ -42,10 +42,7 @@ class ModelMeta(type): cls.fields = dict(inspect.getmembers(cls, lambda f: isinstance(f, Field))) cls.meta = mcls object_class = cls.get_object_class() - - if cls.__name__ != "Model": - MODELS[object_class] = cls - + MODELS[object_class] = cls return cls diff --git a/python/samba/netcmd/shell.py b/python/samba/netcmd/shell.py index 54c4019df36..5df3aa11336 100644 --- a/python/samba/netcmd/shell.py +++ b/python/samba/netcmd/shell.py @@ -50,6 +50,7 @@ class cmd_shell(Command): context.update({ "samdb": samdb, "ldb": ldb, + "Model": Model, }) context.update({model.__name__: model for model in MODELS.values()})