def get_build(self, metadata):
        build_start_time = metadata["creationTimestamp"]
        try:
            # Decode UTC RFC3339 date with no fractional seconds
            # (the format we expect)
            start_time_struct = time.strptime(build_start_time,
                                              '%Y-%m-%dT%H:%M:%SZ')
            start_time = int(time.mktime(start_time_struct))
        except __HOLE__:
            self.log.error("Invalid time format (%s)", build_start_time)
            raise

        name = self.nvr_image.repo
        version, release = self.nvr_image.tag.split('-', 1)

        source = self.workflow.source
        if not isinstance(source, GitSource):
            raise RuntimeError('git source required')

        build = {
            'name': name,
            'version': version,
            'release': release,
            'source': "{0}#{1}".format(source.uri, source.commit_id),
            'start_time': start_time,
            'end_time': int(time.time()),
            'extra': {
                'image': {},
            },
        }

        if self.metadata_only:
            build['metadata_only'] = True

        return build
dataset/ETHPy150Open projectatomic/atomic-reactor/atomic_reactor/plugins/exit_koji_promote.py/KojiPromotePlugin.get_build