diff options
Diffstat (limited to 'cobbler')
-rw-r--r-- | cobbler/check.py | 5 | ||||
-rw-r--r-- | cobbler/config.py | 3 | ||||
-rw-r--r-- | cobbler/sync.py | 3 | ||||
-rw-r--r-- | cobbler/util.py | 6 |
4 files changed, 11 insertions, 6 deletions
diff --git a/cobbler/check.py b/cobbler/check.py index bd4137a..ce0fdaf 100644 --- a/cobbler/check.py +++ b/cobbler/check.py @@ -5,14 +5,15 @@ import os import sys import re +import weakref from msg import * class BootCheck: def __init__(self, api): - self.api = api - self.config = self.api.config + self.api = weakref.proxy(api) + self.config = weakref.proxy(self.api.config) def run(self): diff --git a/cobbler/config.py b/cobbler/config.py index 197da91..ac08ca5 100644 --- a/cobbler/config.py +++ b/cobbler/config.py @@ -6,6 +6,7 @@ import api import util from msg import * +import weakref import syck # pysyck > 0.61, so it has dump() import os @@ -25,7 +26,7 @@ class BootConfig: users of this class need to call deserialize() to load config file values. See cobbler.py for how the CLI does it. """ - self.api = api + self.api = weakref.proxy(api) self.settings_file = global_settings_file self.state_file = global_state_file self.set_defaults() diff --git a/cobbler/sync.py b/cobbler/sync.py index 3494382..f555b4f 100644 --- a/cobbler/sync.py +++ b/cobbler/sync.py @@ -12,6 +12,7 @@ import re import shutil import syck import IPy +import weakref from msg import * """ @@ -21,7 +22,7 @@ Handles conversion of internal state to the tftpboot tree layout class BootSync: def __init__(self,api): - self.api = api + self.api = weakref.proxy(api) self.verbose = True diff --git a/cobbler/util.py b/cobbler/util.py index ae7dde7..3a4d852 100644 --- a/cobbler/util.py +++ b/cobbler/util.py @@ -8,12 +8,14 @@ import os import re import socket import glob +import weakref class BootUtil: def __init__(self,api,config): - self.api = api - self.config = config + # BootAPI is the preferred holder of all references + self.api = weakref.proxy(api) + self.config = weakref.proxy(config) self.re_kernel = re.compile(r'vmlinuz-(\d+)\.(\d+)\.(\d+)-(.*)') self.re_initrd = re.compile(r'initrd-(\d+)\.(\d+)\.(\d+)-(.*).img') |