diff options
author | Hansen, Tony (th1395) <th1395@att.com> | 2020-01-27 22:28:34 +0000 |
---|---|---|
committer | Hansen, Tony (th1395) <th1395@att.com> | 2020-01-31 19:10:12 +0000 |
commit | db08ae5dac684a1155dedfd199ae4e372c82e9df (patch) | |
tree | ad8af5f477614099f32f7d430bbc01a1101d76ce /miss_htbt_service/check_health.py | |
parent | c23a966aaa7e9172c42d8439a3a208000d1762dc (diff) |
increase code coverage
Change-Id: I30632d2e34401f8eff6e67b9b3d8abba32e80050
Signed-off-by: Hansen, Tony (th1395) <th1395@att.com>
Issue-ID: DCAEGEN2-1902
Signed-off-by: Hansen, Tony (th1395) <th1395@att.com>
Diffstat (limited to 'miss_htbt_service/check_health.py')
-rw-r--r-- | miss_htbt_service/check_health.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/miss_htbt_service/check_health.py b/miss_htbt_service/check_health.py index 5732749..03c390b 100644 --- a/miss_htbt_service/check_health.py +++ b/miss_htbt_service/check_health.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # ============LICENSE_START======================================================= -# Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============LICENSE_END========================================================= -# -# ECOMP is a trademark and service mark of AT&T Intellectual Property. from http.server import HTTPServer, BaseHTTPRequestHandler from urllib import parse @@ -45,18 +43,18 @@ class GetHandler(BaseHTTPRequestHandler): ]) self.send_response(200) self.end_headers() - self.wfile.write(message) + self.wfile.write(bytes(message, 'utf-8')) return def do_POST(self): - content_len = int(self.headers.getheader('content-length')) + content_len = int(self.headers.get('content-length', 0)) post_body = self.rfile.read(content_len) self.send_response(200) self.end_headers() data = json.loads(post_body) - self.wfile.write(data['health']) + self.wfile.write(bytes(data['health'], 'utf-8')) return if __name__ == '__main__': |