File 0001-HTTPS-HMs-need-the-same-validation-path-as-HTTP.patch of Package openstack-octavia

From d273100ed72dff6f36dff52745a180a426e3788d Mon Sep 17 00:00:00 2001
From: Adam Harwell <flux.adam@gmail.com>
Date: Mon, 24 Sep 2018 15:14:17 -0700
Subject: [PATCH] HTTPS HMs need the same validation path as HTTP

Change-Id: I2fd51664336dca51f134b3fccd3e8c936b809839
(cherry picked from commit 7dd6f8b846015e6fbe75af09ee3a5108741b1626)
---
 octavia/api/v2/controllers/health_monitor.py     |  3 ++-
 .../functional/api/v2/test_health_monitor.py     | 16 ++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/octavia/api/v2/controllers/health_monitor.py b/octavia/api/v2/controllers/health_monitor.py
index 63cf831d..13a16ff5 100644
--- a/octavia/api/v2/controllers/health_monitor.py
+++ b/octavia/api/v2/controllers/health_monitor.py
@@ -117,7 +117,8 @@ class HealthMonitorController(base.BaseController):
             raise exceptions.InvalidOption(value='None',
                                            option=consts.MAX_RETRIES)
 
-        if hm_dict[consts.TYPE] != consts.HEALTH_MONITOR_HTTP:
+        if hm_dict[consts.TYPE] not in (consts.HEALTH_MONITOR_HTTP,
+                                        consts.HEALTH_MONITOR_HTTPS):
             if hm_dict.get(consts.HTTP_METHOD, None):
                 raise exceptions.InvalidOption(
                     value=consts.HTTP_METHOD, option='health monitors of '
diff --git a/octavia/tests/functional/api/v2/test_health_monitor.py b/octavia/tests/functional/api/v2/test_health_monitor.py
index 82375243..b5b1befd 100644
--- a/octavia/tests/functional/api/v2/test_health_monitor.py
+++ b/octavia/tests/functional/api/v2/test_health_monitor.py
@@ -682,6 +682,22 @@ class TestHealthMonitor(base.BaseAPITest):
         self.assertEqual('/', api_hm.get('url_path'))
         self.assertEqual('200', api_hm.get('expected_codes'))
 
+    def test_create_https_full(self):
+        api_hm = self.create_health_monitor(
+            self.pool_id, constants.HEALTH_MONITOR_HTTPS,
+            1, 1, 1, 1, admin_state_up=False, expected_codes='200',
+            http_method='GET', name='Test HM', url_path='/').get(self.root_tag)
+        self.assertEqual(constants.HEALTH_MONITOR_HTTPS, api_hm.get('type'))
+        self.assertEqual(1, api_hm.get('delay'))
+        self.assertEqual(1, api_hm.get('timeout'))
+        self.assertEqual(1, api_hm.get('max_retries_down'))
+        self.assertEqual(1, api_hm.get('max_retries'))
+        self.assertFalse(api_hm.get('admin_state_up'))
+        self.assertEqual('Test HM', api_hm.get('name'))
+        self.assertEqual('GET', api_hm.get('http_method'))
+        self.assertEqual('/', api_hm.get('url_path'))
+        self.assertEqual('200', api_hm.get('expected_codes'))
+
     def test_create_udp_case(self):
         api_hm = self.create_health_monitor(
             self.udp_pool_with_listener_id,
-- 
2.17.1

openSUSE Build Service is sponsored by