'''
Created on Mar 17, 2013

__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2012-2013, Intel Corp."
__credits__ = ["Elizabeth Flanagan"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "Elizabeth Flanagan"
__email__ = "elizabeth.flanagan@intel.com"
'''

from buildbot.steps.shell import ShellCommand
from twisted.python import log
import os, datetime 
from autobuilder.config import *

class PublishLayerTarballs(ShellCommand):
    haltOnFailure = False 
    flunkOnFailure = True 
    name = "Publishing Layer Tarballs" 
    def __init__(self, factory, layername, workdir, argdict=None, **kwargs):
        self.factory = factory
        self.layername = layername
        self.workdir = workdir
        self.description = "Publishing " + layername + " tarball"
        self.slavedir=os.path.join(os.path.join(YOCTO_ABBASE, "yocto-slave"))
        for k, v in argdict.iteritems():
            setattr(self, k, v)
        self.timeout = 100000
        kwargs['timeout']=self.timeout
        ShellCommand.__init__(self, **kwargs)

    def start(self):
        DEST=self.getProperty("DEST")
        buildername=self.getProperty("buildername")
        self.basedir=os.path.join(os.path.join(os.path.join(
                                    self.slavedir, buildername), self.workdir))
        command="export CURRENT_HASH=`git rev-parse HEAD`;"
        command=command + " git archive --format=tar HEAD | gzip > " 
        command=command + self.layername + "-$CURRENT_HASH.tar.gz; " 
        command=command + "mkdir -p " + DEST + "; rsync -av " 
        command=command + self.layername + "-$CURRENT_HASH.tar.gz " + DEST
        self.command=command
        ShellCommand.start(self)

'''
Created on Mar 17, 2013

__author__ = "Elizabeth 'pidge' Flanagan"
__copyright__ = "Copyright 2012-2013, Intel Corp."
__credits__ = ["Elizabeth Flanagan"]
__license__ = "GPL"
__version__ = "2.0"
__maintainer__ = "Elizabeth Flanagan"
__email__ = "elizabeth.flanagan@intel.com"
'''

from buildbot.steps.shell import ShellCommand
from twisted.python import log
import os, datetime 
from autobuilder.config import *

class PublishLayerTarballs(ShellCommand):
    haltOnFailure = False 
    flunkOnFailure = True 
    name = "Publishing Layer Tarballs" 
    def __init__(self, factory, layername, workdir, argdict=None, **kwargs):
        self.factory = factory
        self.layername = layername
        self.workdir = workdir
        self.description = "Publishing " + layername + " tarball"
        self.slavedir=os.path.join(os.path.join(YOCTO_ABBASE, "yocto-slave"))
        for k, v in argdict.iteritems():
            setattr(self, k, v)
        self.timeout = 100000
        kwargs['timeout']=self.timeout
        ShellCommand.__init__(self, **kwargs)

    def start(self):
        DEST=self.getProperty("DEST")
        buildername=self.getProperty("buildername")
        revision=self.getProperty("got_revision_"+self.layername)
        self.basedir=os.path.join(os.path.join(os.path.join(
                                    self.slavedir, buildername), self.workdir))
        command = " git archive --format=tar HEAD | gzip > " 
        command=command + self.layername + "-" + revision + ".tar.gz; " 
        command=command + "mkdir -p " + DEST + "; rsync -av " 
        command=command + self.layername + "-" + revision +".tar.gz " + DEST
        self.command=command
        ShellCommand.start(self)

Correct the naming of tarballs