From b67ca07bd0dfa232b62e0318b3876973cd39b938 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Tue, 10 Jul 2018 00:44:22 +0200 Subject: [PATCH] Renvoie le mode plain ou ssl pour webmanagement --- topologie/models.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/topologie/models.py b/topologie/models.py index 7952371f..d7205d15 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -286,7 +286,14 @@ class Switch(AclMixin, Machine): @cached_property def web_management_enabled(self): - return OptionalTopologie.get_cached_value('switchs_web_management') or self.automatic_provision + sw_management = OptionalTopologie.get_cached_value('switchs_web_management') + sw_management_ssl = OptionalTopologie.get_cached_value('switchs_web_management_ssl') + if sw_management_ssl: + return "ssl" + elif sw_management: + return "plain" + else: + return self.automatic_provision @cached_property def ipv4(self):