def test(self, load_services_oldstyle, load_defaults): load_services_oldstyle.return_value = {} load_defaults.return_value = {'YADT_LOCK_DIR': '/tmp/yadt-lock/', 'YADT_LOG_DIR': '/tmp/yadt/', 'YADT_SERVICES_FILE': '/etc/yadt.services'} yadt_minion = Status() yadt_minion.get_status()
def test(self, load_settings): load_settings.return_value = {"defaults": {'YADT_LOG_DIR': '/tmp/yadt/log', 'YADT_LOCK_DIR': '/tmp/yadt/', 'YADT_EXITCODE_HOST_LOCKED': 150, 'YADT_EXITCODE_SERVICE_IGNORED': 151, 'YADT_EXITCODE_HOST_REBOOT_TIMEOUT': 152}} yadt_minion = Status() yadt_minion.get_status()
def test(self, load_settings): load_settings.return_value = { "defaults": { 'YADT_LOG_DIR': '/tmp/yadt/log', 'YADT_LOCK_DIR': '/tmp/yadt/', 'YADT_EXITCODE_HOST_LOCKED': 150, 'YADT_EXITCODE_SERVICE_IGNORED': 151, 'YADT_EXITCODE_HOST_REBOOT_TIMEOUT': 152 } } yadt_minion = Status() yadt_minion.get_status()
def load_yadt_defaults_oldstyle(): defaults = Status.load_defaults() return defaults
#!/usr/bin/env python from yadtminion import Status import simplejson as json ys = Status() print json.dumps(ys.get_status(), sort_keys=True, indent=4)