@saharautils.inject_remote('r')
    def install_rpms(self, r):
        LOG.debug("Installing rpm's")

        # TODO(jspeidel): based on image type, use correct command
        curl_cmd = ('curl -f -s -o /etc/yum.repos.d/ambari.repo %s' %
                    self.ambari_rpm)
        ret_code, stdout = r.execute_command(curl_cmd,
                                             run_as_root=True,
                                             raise_when_error=False)
        if ret_code == 0:
            yum_cmd = 'yum -y install %s' % EPEL_RELEASE_PACKAGE_NAME
            r.execute_command(yum_cmd, run_as_root=True)
        else:
            LOG.debug("Unable to install rpm's from repo, "
                      "checking for local install.")

            if not self.rpms_installed():
                raise ex.HadoopProvisionError(
                    _('Failed to install Hortonworks Ambari'))
dataset/ETHPy150Open openstack/sahara/sahara/plugins/hdp/hadoopserver.py/HadoopServer.install_rpms/original