gpo: Do not get templates list on first run
commitd3061f5e9409b8a43363bb46fc81077b3b0cae9b
authorGabriel Nagy <gabriel.nagy@canonical.com>
Fri, 19 Jan 2024 09:36:19 +0000 (19 11:36 +0200)
committerJule Anger <janger@samba.org>
Mon, 5 Feb 2024 11:32:09 +0000 (5 11:32 +0000)
tree4394b679b2f5f5e789d90b3f5cfbcb05914c866d
parent90cf23e1ccab6cef426f4027ffd93496ab7666be
gpo: Do not get templates list on first run

This is a visual fix and has no impact on functionality apart from
cleaner log messages.

The point of this is to get the list of supported templates in order to
compute a diff between the current applied templates and the updated
list, so we are able to unapply and reapply the policy in case there are
differences.

However this code path is executed on first applies as well, at which
point the root CA is not yet set up. This causes the
`get_supported_templates` call to fail, which is not a hard failure but
still pollutes the logs. In this case it's safe to avoid executing the
command as the policy will be applied regardless.

Signed-off-by: Gabriel Nagy <gabriel.nagy@canonical.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan 22 16:48:57 UTC 2024 on atb-devel-224

(cherry picked from commit 8579340fc540633c13c017d896034904a8dbd55c)
python/samba/gp/gp_cert_auto_enroll_ext.py