Commit ae7a2afb authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f66a1717
...@@ -22,8 +22,6 @@ import socket ...@@ -22,8 +22,6 @@ import socket
from datetime import datetime from datetime import datetime
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
from slapos.util import bytes2str
OPML_START = """<?xml version="1.0" encoding="UTF-8"?> OPML_START = """<?xml version="1.0" encoding="UTF-8"?>
<!-- OPML generated by SlapOS --> <!-- OPML generated by SlapOS -->
<opml version="1.1"> <opml version="1.1">
...@@ -233,7 +231,7 @@ class Monitoring(object): ...@@ -233,7 +231,7 @@ class Monitoring(object):
print("ERROR: Timeout with %r while downloading monitor config at %s " % (e, url)) print("ERROR: Timeout with %r while downloading monitor config at %s " % (e, url))
else: else:
try: try:
monitor_dict = json.loads(bytes2str(response.read())) monitor_dict = json.loads(response.read())
monitor_title = monitor_dict.get('title', 'Unknown Instance') monitor_title = monitor_dict.get('title', 'Unknown Instance')
success = True success = True
except ValueError as e: except ValueError as e:
......
...@@ -190,7 +190,7 @@ class RunPromise(GenericPromise): ...@@ -190,7 +190,7 @@ class RunPromise(GenericPromise):
check_date = self.getConfig('test-check-date') check_date = self.getConfig('test-check-date')
path = os.path.join(self.getPartitionFolder(), "") + "extrafolder" path = os.path.join(self.getPartitionFolder(), "") + "extrafolder"
partitions = psutil.disk_partitions() partitions = psutil.disk_partitions()
while path is not '/': while path != '/':
if not disk_partition: if not disk_partition:
path = os.path.dirname(path) path = os.path.dirname(path)
else: else:
......
...@@ -92,7 +92,7 @@ ipv4 = 10.0.151.118 ...@@ -92,7 +92,7 @@ ipv4 = 10.0.151.118
pkg_resources.resource_string( pkg_resources.resource_string(
'slapos.monitor', 'slapos.monitor',
'doc/monitor_instance.schema.json') 'doc/monitor_instance.schema.json')
self.monitor_instance_schema = json.loads(monitor_schema_string.decode('utf-8')) self.monitor_instance_schema = json.loads(monitor_schema_string)
self.monitor_config_dict = dict( self.monitor_config_dict = dict(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment