[oe-commits] Corneliu Stoicescu : oeqa/targetcontrol.py: Separate the matching of supported image fstypes from the resulting value check.
git at git.openembedded.org
git at git.openembedded.org
Tue Jun 24 18:54:33 UTC 2014
Module: openembedded-core.git
Branch: master
Commit: 50ddd5d0149666ad60133d8eb6cc789c5b97e5e4
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=50ddd5d0149666ad60133d8eb6cc789c5b97e5e4
Author: Corneliu Stoicescu <corneliux.stoicescu at intel.com>
Date: Mon Jun 23 15:59:44 2014 +0300
oeqa/targetcontrol.py: Separate the matching of supported image fstypes from the resulting value check.
Because we used a bb.fatal call inside the get_image_fstype classmethod, this caused problems when accessed without instantiating the object with a valid bb environment.
Separating the matching part of the classmethod(that is usable by outside scripts) from the check of the resulting value.
The matching is done within a new classmethod and the latter keeps the old method name and internal functionality, this way we don't have to change any other target controllers code.
Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/lib/oeqa/targetcontrol.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index 1464bf4..cc582dd 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -77,14 +77,21 @@ class BaseTarget(object):
return None
@classmethod
- def get_image_fstype(self, d, image_fstypes=None):
+ def match_image_fstype(self, d, image_fstypes=None):
if not image_fstypes:
image_fstypes = d.getVar('IMAGE_FSTYPES', True).split(' ')
possible_image_fstypes = [fstype for fstype in self.supported_image_fstypes if fstype in image_fstypes]
if possible_image_fstypes:
return possible_image_fstypes[0]
else:
- bb.fatal("no possible image_fstype could not be determined. IMAGE_FSTYPES=\"%s\" and supported_image_fstypes=\"%s\": " % (', '.join(map(str, image_fstypes)), ', '.join(map(str, self.supported_image_fstypes))))
+ return None
+
+ def get_image_fstype(self, d):
+ image_fstype = self.match_image_fstype(d)
+ if image_fstype:
+ return image_fstype
+ else:
+ bb.fatal("IMAGE_FSTYPES should contain a Target Controller supported image fstype: %s " % ', '.join(map(str, self.supported_image_fstypes)))
def restart(self, params=None):
self.stop()
More information about the Openembedded-commits
mailing list