summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyota MIBU <r-mibu@cq.jp.nec.com>2017-09-29 13:01:03 +0000
committerRyota Mibu <r-mibu@cq.jp.nec.com>2017-09-29 13:44:34 +0000
commit6799dee0b48647e5c45fa9341d88822636895259 (patch)
tree425d893fd44956b88710c76257d615be6c0a4dbc
parent82463b273a9f4e026dff7bfa507ddc78ef771517 (diff)
option: "update_neutron_port_dp_status"
This patch introduces new boolean option "update_neutron_port_dp_status", which disabled by default. Change-Id: Iaf7503d5854251fabf816b9bf3fcc1964c231a68 Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com> (cherry picked from commit 9f91aba7ef33d7ad88c3bd004fdf7c5fef65f151)
-rw-r--r--doctor_tests/inspector/__init__.py4
-rw-r--r--doctor_tests/inspector/sample.py9
-rw-r--r--etc/doctor.sample.conf1
3 files changed, 11 insertions, 3 deletions
diff --git a/doctor_tests/inspector/__init__.py b/doctor_tests/inspector/__init__.py
index 3be79e57..a9a86ece 100644
--- a/doctor_tests/inspector/__init__.py
+++ b/doctor_tests/inspector/__init__.py
@@ -26,6 +26,10 @@ OPTS = [
default='12345',
help='the port of default for inspector',
required=False),
+ cfg.BoolOpt('update_neutron_port_dp_status',
+ default=False,
+ help='Update data plane status of affected neutron ports',
+ required=False),
]
diff --git a/doctor_tests/inspector/sample.py b/doctor_tests/inspector/sample.py
index 114e4ebd..fcdb48fe 100644
--- a/doctor_tests/inspector/sample.py
+++ b/doctor_tests/inspector/sample.py
@@ -35,7 +35,8 @@ class SampleInspector(BaseInspector):
auth = get_identity_auth(project=self.conf.doctor_project)
session = get_session(auth=auth)
- self.neutron = neutron_client(session)
+ if self.conf.update_neutron_port_dp_status:
+ self.neutron = neutron_client(session)
self.servers = collections.defaultdict(list)
self.hostnames = list()
@@ -94,10 +95,12 @@ class SampleInspector(BaseInspector):
self.hostnames.append(hostname)
thr1 = self._disable_compute_host(hostname)
thr2 = self._vms_reset_state('error', hostname)
- thr3 = self._set_ports_data_plane_status('DOWN', hostname)
+ if self.conf.update_neutron_port_dp_status:
+ thr3 = self._set_ports_data_plane_status('DOWN', hostname)
thr1.join()
thr2.join()
- thr3.join()
+ if self.conf.update_neutron_port_dp_status:
+ thr3.join()
@utils.run_async
def _disable_compute_host(self, hostname):
diff --git a/etc/doctor.sample.conf b/etc/doctor.sample.conf
index f81d3b2d..56fc8281 100644
--- a/etc/doctor.sample.conf
+++ b/etc/doctor.sample.conf
@@ -37,6 +37,7 @@
#type = local
#ip = 127.0.0.1
#username = root
+#update_neutron_port_dp_status = False
[monitor]
#type = sample