9121332c18e024d417d1aeb189ec98f295ffc694,perfkitbenchmarker/linux_packages/epel_release.py,,YumInstall,#Any#,47

Before Change



def YumInstall(vm):
  Installs epel-release repo.
  try:
    vm.InstallPackages("epel-release")
  except errors.VirtualMachine.RemoteCommandError:
    stdout, _ = vm.RemoteCommand("cat /etc/redhat-release")
    major_version = int(re.search("release ([0-9])", stdout).group(1))
    if major_version == 6:
      epel_rpm = EPEL6_RPM
    elif major_version == 7:
      epel_rpm = EPEL7_RPM
    else:
      raise
    vm.InstallPreprovisionedPackageData(
        PACKAGE_NAME,
        PREPROVISIONED_DATA.keys(),
        INSTALL_DIR)
    vm.RemoteCommand("sudo rpm -ivh --force %s" % posixpath.join(
        INSTALL_DIR, epel_rpm))
  vm.InstallPackages("yum-utils")
  vm.RemoteCommand("sudo yum-config-manager --enable epel")

After Change


def YumInstall(vm):
  Installs epel-release repo.
  if vm.OS_TYPE not in _EPEL_URLS:
    raise errors.Setup.InvalidConfigurationError(
        "os_type {} not in {}".format(vm.OS_TYPE, sorted(_EPEL_URLS)))
  if IsEpelRepoInstalled(vm):
    logging.info("EPEL repo already installed")
    return
  url = _EPEL_URLS[vm.OS_TYPE]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 9121332c18e024d417d1aeb189ec98f295ffc694
Time: 2020-07-28
Author: chriswilkes@google.com
File Name: perfkitbenchmarker/linux_packages/epel_release.py
Class Name:
Method Name: YumInstall


Project Name: tensorflow/tensorboard
Commit Name: aebedd6592a7e76e6e800b698832704e140ccaad
Time: 2021-03-19
Author: github@wchargin.com
File Name: tensorboard/data/server_ingester.py
Class Name: SubprocessServerDataIngester
Method Name: start


Project Name: mittagessen/kraken
Commit Name: 9f200d963b9646fb50326f7cf6788021ddfe955d
Time: 2018-04-08
Author: mittagessen@l.unchti.me
File Name: kraken/lib/models.py
Class Name:
Method Name: load_any