bitbake: cooker: Allow featureset in error state

Currently, if an invalid PR service is selected the server will error
with a traceback. This is because its set into the error state and the
setFeature code will then fail since its not in the initial state.

Modifying the featureset in the error state is acceptable, we just need
to ensure we don't trigger a reset, that would happen from whichever
code handles the error.

[YOCTO #6934]

(Bitbake rev: c52841445d8db8f84c4da34203b195fea5874247)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2014-11-27 14:59:21 +00:00
parent b585c4b8b8
commit 2fc06a12a1

View File

@@ -165,13 +165,13 @@ class BBCooker:
def setFeatures(self, features):
# we only accept a new feature set if we're in state initial, so we can reset without problems
if self.state != state.initial:
if self.state != state.initial and self.state != state.error:
raise Exception("Illegal state for feature set change")
original_featureset = list(self.featureset)
for feature in features:
self.featureset.setFeature(feature)
bb.debug(1, "Features set %s (was %s)" % (original_featureset, list(self.featureset)))
if (original_featureset != list(self.featureset)):
if (original_featureset != list(self.featureset)) and self.state != state.error:
self.reset()
def initConfigurationData(self):