summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Probes.py
diff options
context:
space:
mode:
authorJonah BrĂ¼chert <jbb@kaidan.im>2024-04-19 23:52:23 +0200
committerJonah BrĂ¼chert <jbb@kaidan.im>2024-04-19 23:52:23 +0200
commit2724e6409534a948b5a2c212ae0a7192326c1b4c (patch)
treefe49421ea9c00298c01d5c5c52d0687c2f4bb9fd /src/lib/Bcfg2/Server/Plugins/Probes.py
parent4d140a72fdde0e34060b9fa1ef76e05502245d20 (diff)
downloadbcfg2-2724e6409534a948b5a2c212ae0a7192326c1b4c.tar.gz
bcfg2-2724e6409534a948b5a2c212ae0a7192326c1b4c.tar.bz2
bcfg2-2724e6409534a948b5a2c212ae0a7192326c1b4c.zip
Run 2to3 on the entire project
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Probes.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Probes.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Probes.py b/src/lib/Bcfg2/Server/Plugins/Probes.py
index 270bfa62d..1d9603798 100644
--- a/src/lib/Bcfg2/Server/Plugins/Probes.py
+++ b/src/lib/Bcfg2/Server/Plugins/Probes.py
@@ -10,7 +10,7 @@ import lxml.etree
import Bcfg2.Server
import Bcfg2.Server.Cache
import Bcfg2.Server.Plugin
-from Bcfg2.Compat import unicode, any # pylint: disable=W0622
+from Bcfg2.Compat import str, any # pylint: disable=W0622
import Bcfg2.Server.FileMonitor
from Bcfg2.Logger import Debuggable
from Bcfg2.Server.Statistics import track_statistics
@@ -178,7 +178,7 @@ class DBProbeStore(ProbeStore, Bcfg2.Server.Plugin.DatabaseBacked):
Bcfg2.Server.Cache.expire("Probes", "probedata", hostname)
self._datacache[hostname] = ClientProbeDataSet()
expire_metadata = False
- for probe, pdata in data.items():
+ for probe, pdata in list(data.items()):
self._datacache[hostname][probe] = pdata
try:
record, created = ProbesDataModel.objects.get_or_create(
@@ -196,7 +196,7 @@ class DBProbeStore(ProbeStore, Bcfg2.Server.Plugin.DatabaseBacked):
record.save()
expire_metadata = True
qset = ProbesDataModel.objects.filter(
- hostname=hostname).exclude(probe__in=data.keys())
+ hostname=hostname).exclude(probe__in=list(data.keys()))
if len(qset):
qset.delete()
expire_metadata = True
@@ -283,7 +283,7 @@ class XMLProbeStore(ProbeStore):
Bcfg2.Server.Cache.expire("Probes", "probedata", hostname)
self._datacache[hostname] = ClientProbeDataSet()
expire_metadata = False
- for probe, pdata in data.items():
+ for probe, pdata in list(data.items()):
olddata = self._datacache[hostname].get(probe, ProbeData(''))
self._datacache[hostname][probe] = pdata
expire_metadata |= olddata != data
@@ -308,7 +308,7 @@ class ProbeData(str): # pylint: disable=E0012,R0924
ProbeData objects as XML, JSON, or YAML data """
def __new__(cls, data):
# prevent double encoding utf-8 in python3
- if isinstance(data, unicode) and not isinstance(data, str):
+ if isinstance(data, str) and not isinstance(data, str):
return str.__new__(cls, data.encode('utf-8'))
else:
return str.__new__(cls, data)