observer.py, runconfig.py: Remove NewStyle classes

These classes were removed in buildbot 3.2.x because migration is
complete.

Signed-off-by: Jate Sujjavanich <jatedev@gmail.com>
This commit is contained in:
Jate Sujjavanich 2022-12-06 19:45:48 -05:00
parent e9cd376211
commit acddf34e2a
3 changed files with 18 additions and 18 deletions

View File

@ -88,7 +88,7 @@ def create_builder_factory():
# NOTE: Assumes that yocto-autobuilder repo has been cloned to home # NOTE: Assumes that yocto-autobuilder repo has been cloned to home
# directory of the user running buildbot. # directory of the user running buildbot.
clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir") clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir")
f.addStep(steps.ShellCommandNewStyle( f.addStep(steps.ShellCommand(
command=[clob, util.Interpolate("%(prop:builddir)s/")], command=[clob, util.Interpolate("%(prop:builddir)s/")],
haltOnFailure=True, haltOnFailure=True,
name="Clobber build dir")) name="Clobber build dir"))
@ -102,7 +102,7 @@ def create_builder_factory():
f.addStep(TargetPresent()) f.addStep(TargetPresent())
f.addStep(steps.SetProperties(properties=ensure_props_set)) f.addStep(steps.SetProperties(properties=ensure_props_set))
f.addStep(WriteLayerInfo(name='Write main layerinfo.json', haltOnFailure=True)) f.addStep(WriteLayerInfo(name='Write main layerinfo.json', haltOnFailure=True))
f.addStep(steps.ShellCommandNewStyle( f.addStep(steps.ShellCommand(
command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/shared-repo-unpack"), command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/shared-repo-unpack"),
util.Interpolate("%(prop:builddir)s/layerinfo.json"), util.Interpolate("%(prop:builddir)s/layerinfo.json"),
util.Interpolate("%(prop:builddir)s/build"), util.Interpolate("%(prop:builddir)s/build"),
@ -113,12 +113,12 @@ def create_builder_factory():
haltOnFailure=True, haltOnFailure=True,
name="Unpack shared repositories")) name="Unpack shared repositories"))
f.addStep(steps.SetPropertyFromCommandNewStyle(command=util.Interpolate("cd %(prop:builddir)s/build; git rev-parse HEAD"), f.addStep(steps.SetPropertyFromCommand(command=util.Interpolate("cd %(prop:builddir)s/build; git rev-parse HEAD"),
property="yp_build_revision", property="yp_build_revision",
haltOnFailure=True, haltOnFailure=True,
name='Set build revision')) name='Set build revision'))
f.addStep(steps.SetPropertyFromCommandNewStyle(command=util.Interpolate("cd %(prop:builddir)s/build; git rev-parse --abbrev-ref HEAD"), f.addStep(steps.SetPropertyFromCommand(command=util.Interpolate("cd %(prop:builddir)s/build; git rev-parse --abbrev-ref HEAD"),
property="yp_build_branch", property="yp_build_branch",
haltOnFailure=True, haltOnFailure=True,
name='Set build branch')) name='Set build branch'))
@ -127,7 +127,7 @@ def create_builder_factory():
f.addStep(RunConfigCheckSteps(posttrigger=False)) f.addStep(RunConfigCheckSteps(posttrigger=False))
# If the build was successful, clean up the build directory # If the build was successful, clean up the build directory
f.addStep(steps.ShellCommandNewStyle( f.addStep(steps.ShellCommand(
command=[clob, util.Interpolate("%(prop:builddir)s/")], command=[clob, util.Interpolate("%(prop:builddir)s/")],
doStepIf=lambda step: step.build.results == SUCCESS, doStepIf=lambda step: step.build.results == SUCCESS,
haltOnFailure=False, haltOnFailure=False,
@ -231,7 +231,7 @@ def create_parent_builder_factory(buildername, waitname):
# NOTE: Assumes that yocto-autobuilder repo has been cloned to home # NOTE: Assumes that yocto-autobuilder repo has been cloned to home
# directory of the user running buildbot. # directory of the user running buildbot.
clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir") clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir")
factory.addStep(steps.ShellCommandNewStyle( factory.addStep(steps.ShellCommand(
command=[clob, util.Interpolate("%(prop:builddir)s/")], command=[clob, util.Interpolate("%(prop:builddir)s/")],
haltOnFailure=True, haltOnFailure=True,
name="Clobber build dir")) name="Clobber build dir"))
@ -244,7 +244,7 @@ def create_parent_builder_factory(buildername, waitname):
haltOnFailure=True, haltOnFailure=True,
name='Fetch yocto-autobuilder-helper')) name='Fetch yocto-autobuilder-helper'))
factory.addStep(WriteLayerInfo(name='Write main layerinfo.json', haltOnFailure=True)) factory.addStep(WriteLayerInfo(name='Write main layerinfo.json', haltOnFailure=True))
factory.addStep(steps.ShellCommandNewStyle( factory.addStep(steps.ShellCommand(
command=[ command=[
util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/prepare-shared-repos"), util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/prepare-shared-repos"),
util.Interpolate("%(prop:builddir)s/layerinfo.json"), util.Interpolate("%(prop:builddir)s/layerinfo.json"),
@ -262,7 +262,7 @@ def create_parent_builder_factory(buildername, waitname):
factory.addStep(steps.SetProperty(property="build_type", value="quick")) factory.addStep(steps.SetProperty(property="build_type", value="quick"))
# shared-repo-unpack # shared-repo-unpack
factory.addStep(steps.ShellCommandNewStyle( factory.addStep(steps.ShellCommand(
command=[ command=[
util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/shared-repo-unpack"), util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/shared-repo-unpack"),
util.Interpolate("%(prop:builddir)s/layerinfo.json"), util.Interpolate("%(prop:builddir)s/layerinfo.json"),
@ -274,12 +274,12 @@ def create_parent_builder_factory(buildername, waitname):
haltOnFailure=True, haltOnFailure=True,
name="Unpack shared repositories")) name="Unpack shared repositories"))
factory.addStep(steps.SetPropertyFromCommandNewStyle(command=util.Interpolate("cd %(prop:builddir)s/build; git rev-parse HEAD"), factory.addStep(steps.SetPropertyFromCommand(command=util.Interpolate("cd %(prop:builddir)s/build; git rev-parse HEAD"),
property="yp_build_revision", property="yp_build_revision",
haltOnFailure=True, haltOnFailure=True,
name='Set build revision')) name='Set build revision'))
factory.addStep(steps.SetPropertyFromCommandNewStyle(command=util.Interpolate("cd %(prop:builddir)s/build; git rev-parse --abbrev-ref HEAD"), factory.addStep(steps.SetPropertyFromCommand(command=util.Interpolate("cd %(prop:builddir)s/build; git rev-parse --abbrev-ref HEAD"),
property="yp_build_branch", property="yp_build_branch",
haltOnFailure=True, haltOnFailure=True,
name='Set build branch')) name='Set build branch'))
@ -320,7 +320,7 @@ def create_parent_builder_factory(buildername, waitname):
factory.addStep(RunConfigCheckSteps(posttrigger=True)) factory.addStep(RunConfigCheckSteps(posttrigger=True))
factory.addStep(steps.ShellCommandNewStyle( factory.addStep(steps.ShellCommand(
command=[ command=[
util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/send-qa-email"), util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/send-qa-email"),
util.Property("send_email"), util.Property("send_email"),
@ -333,7 +333,7 @@ def create_parent_builder_factory(buildername, waitname):
name="Send QA Email")) name="Send QA Email"))
factory.addStep(steps.ShellCommandNewStyle( factory.addStep(steps.ShellCommand(
command=["rm", "-fr", util.Interpolate("{}/%(prop:buildername)s-%(prop:buildnumber)s".format(config.sharedrepodir))], command=["rm", "-fr", util.Interpolate("{}/%(prop:buildername)s-%(prop:buildnumber)s".format(config.sharedrepodir))],
haltOnFailure=True, haltOnFailure=True,
name="Remove shared repo dir")) name="Remove shared repo dir"))
@ -349,7 +349,7 @@ def create_doc_builder_factory():
# NOTE: Assumes that yocto-autobuilder repo has been cloned to home # NOTE: Assumes that yocto-autobuilder repo has been cloned to home
# directory of the user running buildbot. # directory of the user running buildbot.
clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir") clob = os.path.expanduser("~/yocto-autobuilder-helper/janitor/clobberdir")
f.addStep(steps.ShellCommandNewStyle( f.addStep(steps.ShellCommand(
command=[clob, util.Interpolate("%(prop:builddir)s/")], command=[clob, util.Interpolate("%(prop:builddir)s/")],
haltOnFailure=True, haltOnFailure=True,
name="Clobber build dir")) name="Clobber build dir"))
@ -374,7 +374,7 @@ def create_doc_builder_factory():
mode='incremental', mode='incremental',
haltOnFailure=True, haltOnFailure=True,
name='Fetch bitbake')) name='Fetch bitbake'))
f.addStep(steps.ShellCommandNewStyle( f.addStep(steps.ShellCommand(
command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/run-docs-build"), command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/run-docs-build"),
util.Interpolate("%(prop:builddir)s"), util.Interpolate("%(prop:builddir)s"),
util.Interpolate("%(prop:builddir)s/yocto-docs"), util.Interpolate("%(prop:builddir)s/yocto-docs"),

View File

@ -9,7 +9,7 @@ from buildbot.process.results import FAILURE
from buildbot.process.results import SKIPPED from buildbot.process.results import SKIPPED
from buildbot.process.results import SUCCESS from buildbot.process.results import SUCCESS
from buildbot.process.results import WARNINGS from buildbot.process.results import WARNINGS
from buildbot.steps.shell import ShellCommandNewStyle from buildbot.steps.shell import ShellCommand
from functools import partial from functools import partial
@ -17,7 +17,7 @@ from functools import partial
# Monitor the step 1-X logs and stdio, collecting up any warnings and errors seen # Monitor the step 1-X logs and stdio, collecting up any warnings and errors seen
# and publish them at the end in their own 'logfile' for ease of access to the user # and publish them at the end in their own 'logfile' for ease of access to the user
# #
class SimpleLogObserver(ShellCommandNewStyle): class SimpleLogObserver(ShellCommand):
warnOnWarnings = True warnOnWarnings = True
warnOnFailure = True warnOnFailure = True

View File

@ -153,7 +153,7 @@ def get_runconfig_step(name, stepname, phase, description, posttrigger):
timeout=16200) # default of 1200s/20min is too short, use 4.5hrs timeout=16200) # default of 1200s/20min is too short, use 4.5hrs
return step return step
class RunConfigCheckSteps(shell.ShellCommandNewStyle): class RunConfigCheckSteps(shell.ShellCommand):
name = 'Check run-config steps to use' name = 'Check run-config steps to use'
descriptionDone = ['Checked which run-config approach to use'] descriptionDone = ['Checked which run-config approach to use']
haltOnFailure = False haltOnFailure = False
@ -214,7 +214,7 @@ class RunConfigCheckSteps(shell.ShellCommandNewStyle):
log = yield self.addLog(logName) log = yield self.addLog(logName)
log.addStdout(message) log.addStdout(message)
class TargetPresent(shell.ShellCommandNewStyle): class TargetPresent(shell.ShellCommand):
name = "Check if branch needs this target" name = "Check if branch needs this target"
command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/target-present"), util.Property("buildername")] command=[util.Interpolate("%(prop:builddir)s/yocto-autobuilder-helper/scripts/target-present"), util.Property("buildername")]