summaryrefslogtreecommitdiffstats
path: root/tests/inspector.py
diff options
context:
space:
mode:
authordongwenjuan <dong.wenjuan@zte.com.cn>2016-12-30 10:23:09 +0800
committerwenjuan dong <dong.wenjuan@zte.com.cn>2017-01-03 07:43:16 +0000
commit836674ae9c96738791463940d713e88d5928f7d8 (patch)
tree20575b92e4d51ac5ec50961488ca8fddf7a82e70 /tests/inspector.py
parentbfd645c60af3bdefae2984636fcb8aae1436b26f (diff)
fix the data which post to sample inspector align to SB API
Change-Id: I18b0703541aa702ec833cd102260e92831a89e3a Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'tests/inspector.py')
-rw-r--r--tests/inspector.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/inspector.py b/tests/inspector.py
index 129a386a..3a0e9ade 100644
--- a/tests/inspector.py
+++ b/tests/inspector.py
@@ -75,10 +75,11 @@ def event_posted():
LOG.info('inspector = %s' % inspector)
LOG.info('received data = %s' % request.data)
d = json.loads(request.data)
- hostname = d['hostname']
- event_type = d['type']
- if event_type == 'compute.host.down':
- inspector.disable_compute_host(hostname)
+ for event in d:
+ hostname = event['details']['hostname']
+ event_type = event['type']
+ if event_type == 'compute.host.down':
+ inspector.disable_compute_host(hostname)
return "OK"