old_contents: '''
  Created on Dec 9, 2014
  
  __author__ = "Alex Damian"
  __copyright__ = "Copyright 2012-2014, Intel Corp."
  __credits__ = ["Elizabeth Flanagan"]
  __license__ = "GPL"
  __version__ = "2.0"
  __maintainer__ = "Alex Damian"
  __email__ = "alexandru.damian@intel.com"
  '''
  
  
  from buildbot.steps.shell import ShellCommand
  from buildbot.process.buildstep import LogLineObserver
  from autobuilder.config import *
  
  
  class UploadToasterEventlog(ShellCommand):
      haltOnFailure = False
      flunkOnFailure = True
      name = "UploadToasterEventlog"
      def __init__(self, factory, argdict=None, **kwargs):
          self.factory = factory
          self.workerdir=os.path.join(os.path.join(YOCTO_ABBASE, "yocto-worker"))
          for k, v in argdict.iteritems():
              setattr(self, k, v)
          # Timeout needs to be passed to LoggingBuildStep as a kwarg
          self.timeout = 100000
          kwargs['timeout']=self.timeout
          ShellCommand.__init__(self, **kwargs)
  
      def start(self):
          self.workerdir=os.path.join(os.path.join(YOCTO_ABBASE, "yocto-worker"))
          self.buildername=self.getProperty("buildername")
          self.layerversion_core = self.getProperty("layerversion_core")
          self.filepath=os.path.join(os.path.join(
                              self.workerdir, self.buildername),
                              "build/build/bitbake_eventlog.json")
  
          if int(self.layerversion_core) < 4:
              self.command = "echo 'Skipping Step.'"
          else:
              if os.environ.get('TOASTER_UPLOAD_URL') is not None:
                  self.toasterserver = str(os.environ.get('TOASTER_UPLOAD_URL'))
  
                  self.command = "curl -F eventlog=@" + self.filepath + " " + self.toasterserver
              else:
                  self.command = "echo environment var TOASTER_UPLOADURL not set - Step is noop"
              self.description = ["Uploading toaster data"]
          ShellCommand.start(self)
  
new_contents: '''
  Created on Dec 9, 2014
  
  __author__ = "Alex Damian"
  __copyright__ = "Copyright 2012-2014, Intel Corp."
  __credits__ = ["Elizabeth Flanagan"]
  __license__ = "GPL"
  __version__ = "2.0"
  __maintainer__ = "Alex Damian"
  __email__ = "alexandru.damian@intel.com"
  '''
  
  
  from buildbot.steps.shell import ShellCommand
  from buildbot.process.buildstep import LogLineObserver
  from autobuilder.config import *
  
  
  class UploadToasterEventlog(ShellCommand):
      haltOnFailure = False
      flunkOnFailure = True
      name = "UploadToasterEventlog"
      def __init__(self, factory, argdict=None, **kwargs):
          self.factory = factory
          self.workerdir=os.path.join(os.path.join(YOCTO_ABBASE, "yocto-worker"))
          for k, v in argdict.iteritems():
              setattr(self, k, v)
          # Timeout needs to be passed to LoggingBuildStep as a kwarg
          self.timeout = 100000
          kwargs['timeout']=self.timeout
          ShellCommand.__init__(self, **kwargs)
  
      def start(self):
          self.workerdir=os.path.join(os.path.join(YOCTO_ABBASE, "yocto-worker"))
          self.buildername=self.getProperty("buildername")
          self.layerversion_core = self.getProperty("layerversion_core")
          self.filepath=os.path.join(os.path.join(
                              self.workerdir, self.buildername),
                              "build/build/bitbake_eventlog.json")
  
          if int(self.layerversion_core) < 5:
              self.command = "echo 'Skipping Step.'"
          else:
              if os.environ.get('TOASTER_UPLOAD_URL') is not None:
                  self.toasterserver = str(os.environ.get('TOASTER_UPLOAD_URL'))
  
                  self.command = "curl -F eventlog=@" + self.filepath + " " + self.toasterserver
              else:
                  self.command = "echo environment var TOASTER_UPLOADURL not set - Step is noop"
              self.description = ["Uploading toaster data"]
          ShellCommand.start(self)
  
subject: Exclude layerversion_core < 5