Class: Specinfra::Command::Redhat::Base::Yumrepo

Inherits:
Linux::Base::Yumrepo show all
Defined in:
lib/specinfra/command/redhat/base/yumrepo.rb

Direct Known Subclasses

Amazon::V2022::Yumrepo, V8::Yumrepo

Class Method Summary collapse

Methods inherited from Base

escape

Class Method Details

.check_exists(repository) ⇒ Object



11
12
13
# File 'lib/specinfra/command/redhat/base/yumrepo.rb', line 11

def check_exists(repository)
  "yum repolist all -C | grep -qsE \"^[\\!\\*]?#{escape(repository)}\(\\s\|$\|\\/)\""
end

.check_is_enabled(repository) ⇒ Object



15
16
17
# File 'lib/specinfra/command/redhat/base/yumrepo.rb', line 15

def check_is_enabled(repository)
  "yum repolist enabled -C | grep -qs \"^[\\!\\*]\\?#{escape(repository)}\""
end

.create(os_info = nil) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/specinfra/command/redhat/base/yumrepo.rb', line 3

def create(os_info=nil)
  if (os_info || os)[:release].to_i < 8
    self
  else
    Specinfra::Command::Redhat::V8::Yumrepo
  end
end