summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorevasquez <eric.vasquez@calxeda.com>2013-07-12 12:34:35 -0500
committerevasquez <eric.vasquez@calxeda.com>2013-07-12 12:34:35 -0500
commit1a1d383f3f2d3147df9bc87cf54d9a10bf0ecbf9 (patch)
tree3225da66a716712f00c591ed2003b2d363f94e36
parentf8d6b408331489e6b81ff275f409cfe063e9e333 (diff)
downloadcxmanage-1a1d383f3f2d3147df9bc87cf54d9a10bf0ecbf9.tar.gz
Moved tftp to lazy init.
When we load tests from modules, each testcase gets initialized, therefore a fabric is created for every test case based on the manifest. This caused a problem with LTP which generated ~1000 tests, thus ~1000 fabrics and finally ~1000 Internal tftp servers. Move tftp to lazy init so we only create one when we need one, on demand.
-rw-r--r--cxmanage_api/fabric.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cxmanage_api/fabric.py b/cxmanage_api/fabric.py
index fd71fdc..61a0860 100644
--- a/cxmanage_api/fabric.py
+++ b/cxmanage_api/fabric.py
@@ -77,9 +77,6 @@ class Fabric(object):
if (not self.task_queue):
self.task_queue = DEFAULT_TASK_QUEUE
- if (not self._tftp):
- self._tftp = InternalTftp()
-
def __eq__(self, other):
"""__eq__() override."""
return (isinstance(other, Fabric) and self.nodes == other.nodes)
@@ -104,6 +101,9 @@ class Fabric(object):
:rtype: `Tftp <tftp.html>`_
"""
+ if (not self._tftp):
+ self._tftp = InternalTftp()
+
return self._tftp
@tftp.setter