From 61cd508fe06c10ab1a9f3b0ad2e358ebeeebf4d1 Mon Sep 17 00:00:00 2001 From: evanyeyeye <14984764+evanyeyeye@users.noreply.github.com> Date: Sat, 20 Jan 2024 13:31:08 -0500 Subject: [PATCH] Use getattr for config --- restful_tango/tangoREST.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/restful_tango/tangoREST.py b/restful_tango/tangoREST.py index c8840c63..e8b10c6f 100644 --- a/restful_tango/tangoREST.py +++ b/restful_tango/tangoREST.py @@ -113,8 +113,8 @@ def checkFileExists(self, directory, filename, fileMD5): def createTangoMachine(self, image, vmms=Config.VMMS_NAME, vmObj=None): """createTangoMachine - Creates a tango machine object from image""" - cores = Config.DOCKER_CORES_LIMIT - memory = Config.DOCKER_MEMORY_LIMIT + cores = getattr(Config, "DOCKER_CORES_LIMIT", None) + memory = getattr(Config, "DOCKER_MEMORY_LIMIT", None) if vmObj and "cores" in vmObj and "memory" in vmObj: cores = vmObj["cores"] memory = vmObj["memory"]