aboutsummaryrefslogtreecommitdiffstats
path: root/sdv/docker/sdvstate/validator/airship
diff options
context:
space:
mode:
Diffstat (limited to 'sdv/docker/sdvstate/validator/airship')
-rw-r--r--sdv/docker/sdvstate/validator/airship/airship.py4
-rw-r--r--sdv/docker/sdvstate/validator/airship/compute_check.py19
2 files changed, 20 insertions, 3 deletions
diff --git a/sdv/docker/sdvstate/validator/airship/airship.py b/sdv/docker/sdvstate/validator/airship/airship.py
index 18de66d..f2bdebd 100644
--- a/sdv/docker/sdvstate/validator/airship/airship.py
+++ b/sdv/docker/sdvstate/validator/airship/airship.py
@@ -21,7 +21,7 @@ import logging
from datetime import datetime as dt
from tools.conf import settings
-from tools.kube_utils import load_kube_api
+from tools.kube_utils import load_kube_api, delete_kube_curl_pod
from validator.validator import Validator
from . import *
@@ -92,6 +92,8 @@ class AirshipValidator(Validator):
self.update_report(nova_scheduler_filters_check())
self.update_report(cpu_allocation_ratio_check())
+ delete_kube_curl_pod()
+
self._report['stop_date'] = dt.now().strftime('%Y-%m-%d %H:%M:%S')
diff --git a/sdv/docker/sdvstate/validator/airship/compute_check.py b/sdv/docker/sdvstate/validator/airship/compute_check.py
index ff6f6db..a602471 100644
--- a/sdv/docker/sdvstate/validator/airship/compute_check.py
+++ b/sdv/docker/sdvstate/validator/airship/compute_check.py
@@ -18,6 +18,7 @@ Compute Related Checks
import configparser
import json
+import re
from tools.kube_utils import kube_exec, get_pod_with_labels
from tools.conf import settings
@@ -291,7 +292,14 @@ def trace_vswitch_pmd_cores():
cmd = ['ovs-vsctl', '-t', '5', 'get', 'Open_vSwitch', '.', 'other_config']
response = kube_exec(ovs_pod, cmd)
- response.replace('=', ':')
+ # convert config str to json str
+ match = re.findall("[a-zA-Z0-9-]+=", response)
+ for key in match:
+ response = response.replace(key, '"' + key[:-1] + '":')
+ match = re.findall(":[a-zA-Z0-9-]+", response)
+ for key in match:
+ response = response.replace(key[1:], '"' + key[1:] + '"')
+
config = json.loads(response)
if 'pmd-cpu-mask' in config:
@@ -330,7 +338,14 @@ def trace_vswitch_dpdk_lcores():
cmd = ['ovs-vsctl', '-t', '5', 'get', 'Open_vSwitch', '.', 'other_config']
response = kube_exec(ovs_pod, cmd)
- response.replace('=', ':')
+ # convert config str to json str
+ match = re.findall("[a-zA-Z0-9-]+=", response)
+ for key in match:
+ response = response.replace(key, '"' + key[:-1] + '":')
+ match = re.findall(":[a-zA-Z0-9-]+", response)
+ for key in match:
+ response = response.replace(key[1:], '"' + key[1:] + '"')
+
config = json.loads(response)
if 'dpdk-lcore-mask' in config: