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

Before Change


    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)

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]
  if url:
    vm.InstallPackages(url)
  if vm.OS_TYPE in _EPEL_CMDS:
    vm.RemoteCommand(_EPEL_CMDS[vm.OS_TYPE])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

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: f39e55b044ab3de6b648b6c7e5f2504123a037b5
Time: 2019-07-26
Author: wchargin@gmail.com
File Name: tensorboard/manager.py
Class Name:
Method Name: _info_from_string


Project Name: pantsbuild/pants
Commit Name: 096b135b0b19f9425d97b1f77afb521f5b8584b5
Time: 2019-05-15
Author: 1305167+cosmicexplorer@users.noreply.github.com
File Name: src/python/pants/backend/python/subsystems/python_native_code.py
Class Name: PythonNativeCode
Method Name: check_build_for_current_platform_only