Skip to content

Commit

Permalink
Use getattr for config
Browse files Browse the repository at this point in the history
  • Loading branch information
evanyeyeye committed Jan 20, 2024
1 parent 9839624 commit 61cd508
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions restful_tango/tangoREST.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 61cd508

Please sign in to comment.