Esempio n. 1
0
def writeRpmDetails(nameOfFile, sha, bucketName, artifactsDir):
  """
  Get the rpm name for the corresponding sha and write it to a file.

  :param nameOfFile: grok to describe the rpm name
  :param sha: rpm name with the corresponding sha
  :param bucketName: bucket name from where the sha file would be downloaded
  :param artifactsDir: location of build artifacts to store the file
  """
  try:
    rpmName = getMappingsFromShaToRpm(repo=nameOfFile,
                                      sha=sha,
                                      s3MappingBucket=bucketName,
                                      logger=g_logger)
    with open(os.path.join(artifactsDir, "%s.txt" % nameOfFile), "w") as fp:
      fp.write(rpmName.strip())
  except Exception:
    g_logger.exception("Caught an exception while writing to file")
    raise
Esempio n. 2
0
def writeRpmDetails(nameOfFile, sha, bucketName, artifactsDir):
    """
  Get the rpm name for the corresponding sha and write it to a file.

  :param nameOfFile: grok to describe the rpm name
  :param sha: rpm name with the corresponding sha
  :param bucketName: bucket name from where the sha file would be downloaded
  :param artifactsDir: location of build artifacts to store the file
  """
    try:
        rpmName = getMappingsFromShaToRpm(repo=nameOfFile,
                                          sha=sha,
                                          s3MappingBucket=bucketName,
                                          logger=g_logger)
        with open(os.path.join(artifactsDir, "%s.txt" % nameOfFile),
                  "w") as fp:
            fp.write(rpmName.strip())
    except Exception:
        g_logger.exception("Caught an exception while writing to file")
        raise
Esempio n. 3
0
def downloadGrokRPM(grokSHA, workDir):
  """
  Download the grok rpm for a given SHA

  :param grokSHA - SHA we need a Grok RPM for
  :param workDir - Where to store the downloaded RPM

  :returns full path to the Grok RPM

  :rtype string
  """
  grokRpmName = getMappingsFromShaToRpm(
                  repo="grok",
                  sha=grokSHA,
                  s3MappingBucket=g_config["S3_MAPPING_BUCKET"],
                  logger=g_logger)
  g_logger.debug("Found grok RPM name %s, downloading", grokRpmName)
  with changeToWorkingDir(workDir):
    downloadFileFromS3(bucketName=S3_YUM_BUCKET,
                       path="s3/x86_64/%s" % grokRpmName,
                       logger=g_logger)
  return "%s/%s" % (workDir, grokRpmName)
Esempio n. 4
0
def downloadGrokRPM(grokSHA, workDir):
    """
  Download the grok rpm for a given SHA

  :param grokSHA - SHA we need a Grok RPM for
  :param workDir - Where to store the downloaded RPM

  :returns full path to the Grok RPM

  :rtype string
  """
    grokRpmName = getMappingsFromShaToRpm(
        repo="grok",
        sha=grokSHA,
        s3MappingBucket=g_config["S3_MAPPING_BUCKET"],
        logger=g_logger)
    g_logger.debug("Found grok RPM name %s, downloading", grokRpmName)
    with changeToWorkingDir(workDir):
        downloadFileFromS3(bucketName=S3_YUM_BUCKET,
                           path="yum/x86_64/%s" % grokRpmName,
                           logger=g_logger)
    return "%s/%s" % (workDir, grokRpmName)