From a81a6d84424f4e591f47a033d593470350e329d5 Mon Sep 17 00:00:00 2001 From: Marcus Vinicius Goncalves Cesario Date: Thu, 2 Apr 2015 22:07:06 -0300 Subject: [PATCH] Code was loading requestvip data from database and not respecting the changes send by user. Although user send data with None in healthcheck_expect, the code was not setting this value int DB, raising errors. Fix #25 --- networkapi/requisicaovips/models.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/networkapi/requisicaovips/models.py b/networkapi/requisicaovips/models.py index e1c4d905a..3c1c3b824 100644 --- a/networkapi/requisicaovips/models.py +++ b/networkapi/requisicaovips/models.py @@ -1211,6 +1211,11 @@ def valid_values_healthcheck(self, vip_map, vip, evironment_vip): self.log.error( u'The healthcheck_type parameter is %s, then healthcheck and id_healthcheck_expect must be None.', healthcheck_type) return vip_map, vip, 276 + else: + vip_map['healthcheck'] = None + # Set id_healthcheck_expect to None + vip.healthcheck_expect = None + # If healthcheck_type is 'HTTP' id_healthcheck_expect and healthcheck # must NOT be None @@ -1247,10 +1252,6 @@ def valid_values_healthcheck(self, vip_map, vip, evironment_vip): self.log.error( 'The id_healthcheck_expect parameter does not exist.') raise HealthcheckExpectNotFoundError(None) - else: - vip_map['healthcheck'] = None - # Set id_healthcheck_expect to None - vip.healthcheck_expect = None # Make changes in healthcheck # Set healthcheck_type