inspec 0.14.8 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -2
- data/bin/inspec +3 -4
- data/examples/inheritance/README.md +19 -0
- data/examples/inheritance/controls/example.rb +11 -0
- data/examples/inheritance/inspec.yml +10 -0
- data/lib/bundles/inspec-compliance/cli.rb +1 -4
- data/lib/bundles/inspec-supermarket/cli.rb +1 -4
- data/lib/inspec/dsl.rb +48 -55
- data/lib/inspec/profile.rb +6 -2
- data/lib/inspec/profile_context.rb +21 -8
- data/lib/inspec/runner.rb +17 -12
- data/lib/inspec/runner_rspec.rb +1 -0
- data/lib/inspec/version.rb +1 -1
- data/lib/resources/apache.rb +20 -18
- data/lib/resources/apache_conf.rb +92 -90
- data/lib/resources/apt.rb +92 -90
- data/lib/resources/audit_policy.rb +35 -33
- data/lib/resources/auditd_conf.rb +41 -39
- data/lib/resources/auditd_rules.rb +155 -153
- data/lib/resources/bond.rb +1 -1
- data/lib/resources/bridge.rb +97 -95
- data/lib/resources/command.rb +47 -45
- data/lib/resources/csv.rb +23 -21
- data/lib/resources/directory.rb +1 -1
- data/lib/resources/etc_group.rb +116 -114
- data/lib/resources/file.rb +1 -1
- data/lib/resources/gem.rb +39 -37
- data/lib/resources/group.rb +100 -98
- data/lib/resources/host.rb +103 -101
- data/lib/resources/inetd_conf.rb +42 -40
- data/lib/resources/ini.rb +15 -13
- data/lib/resources/interface.rb +106 -104
- data/lib/resources/iptables.rb +36 -34
- data/lib/resources/json.rb +64 -62
- data/lib/resources/kernel_module.rb +30 -28
- data/lib/resources/kernel_parameter.rb +44 -42
- data/lib/resources/limits_conf.rb +41 -39
- data/lib/resources/login_def.rb +38 -36
- data/lib/resources/mount.rb +43 -41
- data/lib/resources/mysql.rb +67 -65
- data/lib/resources/mysql_conf.rb +89 -87
- data/lib/resources/mysql_session.rb +46 -44
- data/lib/resources/npm.rb +35 -33
- data/lib/resources/ntp_conf.rb +44 -42
- data/lib/resources/oneget.rb +46 -44
- data/lib/resources/os.rb +22 -20
- data/lib/resources/os_env.rb +47 -45
- data/lib/resources/package.rb +213 -211
- data/lib/resources/parse_config.rb +59 -57
- data/lib/resources/passwd.rb +89 -87
- data/lib/resources/pip.rb +60 -58
- data/lib/resources/port.rb +352 -350
- data/lib/resources/postgres.rb +26 -24
- data/lib/resources/postgres_conf.rb +66 -64
- data/lib/resources/postgres_session.rb +47 -45
- data/lib/resources/processes.rb +56 -54
- data/lib/resources/registry_key.rb +150 -148
- data/lib/resources/script.rb +30 -28
- data/lib/resources/security_policy.rb +56 -54
- data/lib/resources/service.rb +638 -636
- data/lib/resources/shadow.rb +98 -96
- data/lib/resources/ssh_conf.rb +58 -56
- data/lib/resources/user.rb +363 -361
- data/lib/resources/windows_feature.rb +46 -44
- data/lib/resources/xinetd.rb +111 -109
- data/lib/resources/yaml.rb +16 -14
- data/lib/resources/yum.rb +107 -105
- data/lib/utils/base_cli.rb +18 -0
- data/test/helper.rb +2 -2
- data/test/unit/profile_context_test.rb +1 -1
- data/test/unit/resources/file_test.rb +1 -1
- data/test/unit/resources/mount_test.rb +1 -1
- metadata +5 -2
@@ -27,57 +27,59 @@
|
|
27
27
|
# "Installed": false,
|
28
28
|
# "InstallState": 0
|
29
29
|
# }
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
30
|
+
module Inspec::Resources
|
31
|
+
class WindowsFeature < Inspec.resource(1)
|
32
|
+
name 'windows_feature'
|
33
|
+
desc 'Use the windows_feature InSpec audit resource to test features on Microsoft Windows.'
|
34
|
+
example "
|
35
|
+
describe windows_feature('dhcp') do
|
36
|
+
it { should be_installed }
|
37
|
+
end
|
38
|
+
"
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
40
|
+
def initialize(feature)
|
41
|
+
@feature = feature
|
42
|
+
@cache = nil
|
42
43
|
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
# verify that this resource is only supported on Windows
|
45
|
+
return skip_resource 'The `windows_feature` resource is not supported on your OS.' if inspec.os[:family] != 'windows'
|
46
|
+
end
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
# returns true if the package is installed
|
49
|
+
def installed?(_provider = nil, _version = nil)
|
50
|
+
info[:installed] == true
|
51
|
+
end
|
51
52
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
# returns the package description
|
54
|
+
def info
|
55
|
+
return @cache if !@cache.nil?
|
56
|
+
features_cmd = "Get-WindowsFeature | Where-Object {$_.Name -eq '#{@feature}' -or $_.DisplayName -eq '#{@feature}'} | Select-Object -Property Name,DisplayName,Description,Installed,InstallState | ConvertTo-Json"
|
57
|
+
cmd = inspec.command(features_cmd)
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
@cache = {
|
60
|
+
name: @feature,
|
61
|
+
type: 'windows-feature',
|
62
|
+
}
|
62
63
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
64
|
+
# cannot rely on exit code for now, successful command returns exit code 1
|
65
|
+
# return nil if cmd.exit_status != 0
|
66
|
+
# try to parse json
|
67
|
+
begin
|
68
|
+
params = JSON.parse(cmd.stdout)
|
69
|
+
rescue JSON::ParserError => _e
|
70
|
+
return @cache
|
71
|
+
end
|
71
72
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
73
|
+
@cache = {
|
74
|
+
name: params['Name'],
|
75
|
+
description: params['Description'],
|
76
|
+
installed: params['Installed'],
|
77
|
+
type: 'windows-feature',
|
78
|
+
}
|
79
|
+
end
|
79
80
|
|
80
|
-
|
81
|
-
|
81
|
+
def to_s
|
82
|
+
"Windows Feature '#{@feature}'"
|
83
|
+
end
|
82
84
|
end
|
83
85
|
end
|
data/lib/resources/xinetd.rb
CHANGED
@@ -4,139 +4,141 @@
|
|
4
4
|
|
5
5
|
require 'utils/parser'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
module Inspec::Resources
|
8
|
+
class XinetdConf < Inspec.resource(1) # rubocop:disable Metrics/ClassLength
|
9
|
+
name 'xinetd_conf'
|
10
|
+
desc 'Xinetd services configuration.'
|
11
|
+
example "
|
12
|
+
describe xinetd_conf.services('chargen') do
|
13
|
+
its('socket_types') { should include 'dgram' }
|
14
|
+
end
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
describe xinetd_conf.services('chargen').socket_types('dgram') do
|
17
|
+
it { should be_disabled }
|
18
|
+
end
|
19
|
+
"
|
19
20
|
|
20
|
-
|
21
|
+
include XinetdParser
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
def initialize(conf_path = '/etc/xinetd.conf', opts = {})
|
24
|
+
@conf_path = conf_path
|
25
|
+
@params = opts[:params] unless opts[:params].nil?
|
26
|
+
@filters = opts[:filters] || ''
|
27
|
+
@contents = {}
|
28
|
+
end
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
def to_s
|
31
|
+
"Xinetd config #{@conf_path}"
|
32
|
+
end
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
def services(condition = nil)
|
35
|
+
condition.nil? ? params['services'].keys : filter(service: condition)
|
36
|
+
end
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
38
|
+
def ids(condition = nil)
|
39
|
+
condition.nil? ? services_field('id') : filter(id: condition)
|
40
|
+
end
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
42
|
+
def socket_types(condition = nil)
|
43
|
+
condition.nil? ? services_field('socket_type') : filter(socket_type: condition)
|
44
|
+
end
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
46
|
+
def types(condition = nil)
|
47
|
+
condition.nil? ? services_field('type') : filter(type: condition)
|
48
|
+
end
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
50
|
+
def wait(condition = nil)
|
51
|
+
condition.nil? ? services_field('wait') : filter(wait: condition)
|
52
|
+
end
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
54
|
+
def disabled?
|
55
|
+
filter(disable: 'no').services.empty?
|
56
|
+
end
|
56
57
|
|
57
|
-
|
58
|
-
|
59
|
-
|
58
|
+
def enabled?
|
59
|
+
filter(disable: 'yes').services.empty?
|
60
|
+
end
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
62
|
+
def params
|
63
|
+
return @params if defined?(@params)
|
64
|
+
return @params = {} if read_content.nil?
|
65
|
+
flat_params = parse_xinetd(read_content)
|
66
|
+
@params = { 'services' => {} }
|
67
|
+
flat_params.each do |k, v|
|
68
|
+
name = k[/^service (.+)$/, 1]
|
69
|
+
if name.nil?
|
70
|
+
@params[k] = v
|
71
|
+
else
|
72
|
+
@params['services'][name] = v
|
73
|
+
end
|
72
74
|
end
|
75
|
+
@params
|
73
76
|
end
|
74
|
-
@params
|
75
|
-
end
|
76
77
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
78
|
+
def filter(conditions = {})
|
79
|
+
res = params.dup
|
80
|
+
filters = ''
|
81
|
+
conditions.each do |k, v|
|
82
|
+
v = v.to_s if v.is_a? Integer
|
83
|
+
filters += " #{k} = #{v.inspect}"
|
84
|
+
res['services'] = filter_by(res['services'], k.to_s, v)
|
85
|
+
end
|
86
|
+
XinetdConf.new(@conf_path, params: res, filters: filters)
|
84
87
|
end
|
85
|
-
XinetdConf.new(@conf_path, params: res, filters: filters)
|
86
|
-
end
|
87
88
|
|
88
|
-
|
89
|
+
private
|
89
90
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
end
|
98
|
-
|
99
|
-
def match_condition(sth, condition)
|
100
|
-
case sth
|
101
|
-
# this does Regex-matching as well as string comparison
|
102
|
-
when condition
|
103
|
-
true
|
104
|
-
else
|
105
|
-
false
|
91
|
+
# Retrieve the provided field from all configured services.
|
92
|
+
#
|
93
|
+
# @param [String] field name, e.g. `socket_type`
|
94
|
+
# @return [Array[String]] all values of this field across services
|
95
|
+
def services_field(field)
|
96
|
+
params['services'].values.compact.flatten
|
97
|
+
.map { |x| x.params[field] }.flatten.compact
|
106
98
|
end
|
107
|
-
end
|
108
99
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
if k == 'service'
|
118
|
-
return Hash[services.find_all { |name, _| match_condition(v, name) }]
|
100
|
+
def match_condition(sth, condition)
|
101
|
+
case sth
|
102
|
+
# this does Regex-matching as well as string comparison
|
103
|
+
when condition
|
104
|
+
true
|
105
|
+
else
|
106
|
+
false
|
107
|
+
end
|
119
108
|
end
|
120
|
-
Hash[services.map { |name, service_arr|
|
121
|
-
found = service_arr.find_all { |service|
|
122
|
-
match_condition(service.params[k], v)
|
123
|
-
}
|
124
|
-
found.empty? ? nil : [name, found]
|
125
|
-
}.compact]
|
126
|
-
end
|
127
109
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
110
|
+
# Filter services by a criteria. This allows for search queries for
|
111
|
+
# certain values.
|
112
|
+
#
|
113
|
+
# @param [Hash] service collection
|
114
|
+
# @param [String] search key you want to query
|
115
|
+
# @param [Any] search value that the key should match
|
116
|
+
# @return [Hash] filtered service collection
|
117
|
+
def filter_by(services, k, v)
|
118
|
+
if k == 'service'
|
119
|
+
return Hash[services.find_all { |name, _| match_condition(v, name) }]
|
120
|
+
end
|
121
|
+
Hash[services.map { |name, service_arr|
|
122
|
+
found = service_arr.find_all { |service|
|
123
|
+
match_condition(service.params[k], v)
|
124
|
+
}
|
125
|
+
found.empty? ? nil : [name, found]
|
126
|
+
}.compact]
|
133
127
|
end
|
134
128
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
129
|
+
def read_content(path = @conf_path)
|
130
|
+
return @contents[path] if @contents.key?(path)
|
131
|
+
file = inspec.file(path)
|
132
|
+
if !file.file?
|
133
|
+
return skip_resource "Can't find file \"#{path}\""
|
134
|
+
end
|
135
|
+
|
136
|
+
@contents[path] = file.content
|
137
|
+
if @contents[path].empty? && file.size > 0
|
138
|
+
return skip_resource "Can't read file \"#{path}\""
|
139
|
+
end
|
139
140
|
|
140
|
-
|
141
|
+
@contents[path]
|
142
|
+
end
|
141
143
|
end
|
142
144
|
end
|
data/lib/resources/yaml.rb
CHANGED
@@ -9,21 +9,23 @@ require 'yaml'
|
|
9
9
|
# describe yaml('.kitchen.yaml') do
|
10
10
|
# its('driver.name') { should eq('vagrant') }
|
11
11
|
# end
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
module Inspec::Resources
|
13
|
+
class YamlConfig < JsonConfig
|
14
|
+
name 'yaml'
|
15
|
+
desc 'Use the yaml InSpec audit resource to test configuration data in a YAML file.'
|
16
|
+
example "
|
17
|
+
describe yaml do
|
18
|
+
its('name') { should eq 'foo' }
|
19
|
+
end
|
20
|
+
"
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
# override file load and parse hash from yaml
|
23
|
+
def parse(content)
|
24
|
+
YAML.load(content)
|
25
|
+
end
|
25
26
|
|
26
|
-
|
27
|
-
|
27
|
+
def to_s
|
28
|
+
"YAML #{@path}"
|
29
|
+
end
|
28
30
|
end
|
29
31
|
end
|
data/lib/resources/yum.rb
CHANGED
@@ -30,132 +30,134 @@ require 'resources/file'
|
|
30
30
|
# it { should be_enabled }
|
31
31
|
# end
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
"
|
42
|
-
|
43
|
-
# returns all repositories
|
44
|
-
# works as following:
|
45
|
-
# search for Repo-id
|
46
|
-
# parse data in hashmap
|
47
|
-
# store data in object
|
48
|
-
# until \n
|
49
|
-
def repositories
|
50
|
-
return @cache if defined?(@cache)
|
51
|
-
# parse the repository data from yum
|
52
|
-
# we cannot use -C, because this is not reliable and may lead to errors
|
53
|
-
@command_result = inspec.command('yum -v repolist all')
|
54
|
-
@content = @command_result.stdout
|
55
|
-
@cache = []
|
56
|
-
repo = {}
|
57
|
-
in_repo = false
|
58
|
-
@content.each_line do |line|
|
59
|
-
# detect repo start
|
60
|
-
in_repo = true if line =~ /^\s*Repo-id\s*:\s*(.*)\b/
|
61
|
-
# detect repo end
|
62
|
-
if line == "\n" && in_repo
|
63
|
-
in_repo = false
|
64
|
-
@cache.push(repo)
|
65
|
-
repo = {}
|
33
|
+
module Inspec::Resources
|
34
|
+
class Yum < Inspec.resource(1)
|
35
|
+
name 'yum'
|
36
|
+
desc 'Use the yum InSpec audit resource to test packages in the Yum repository.'
|
37
|
+
example "
|
38
|
+
describe yum.repo('name') do
|
39
|
+
it { should exist }
|
40
|
+
it { should be_enabled }
|
66
41
|
end
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
42
|
+
"
|
43
|
+
|
44
|
+
# returns all repositories
|
45
|
+
# works as following:
|
46
|
+
# search for Repo-id
|
47
|
+
# parse data in hashmap
|
48
|
+
# store data in object
|
49
|
+
# until \n
|
50
|
+
def repositories
|
51
|
+
return @cache if defined?(@cache)
|
52
|
+
# parse the repository data from yum
|
53
|
+
# we cannot use -C, because this is not reliable and may lead to errors
|
54
|
+
@command_result = inspec.command('yum -v repolist all')
|
55
|
+
@content = @command_result.stdout
|
56
|
+
@cache = []
|
57
|
+
repo = {}
|
58
|
+
in_repo = false
|
59
|
+
@content.each_line do |line|
|
60
|
+
# detect repo start
|
61
|
+
in_repo = true if line =~ /^\s*Repo-id\s*:\s*(.*)\b/
|
62
|
+
# detect repo end
|
63
|
+
if line == "\n" && in_repo
|
64
|
+
in_repo = false
|
65
|
+
@cache.push(repo)
|
66
|
+
repo = {}
|
67
|
+
end
|
68
|
+
# parse repo content
|
69
|
+
if in_repo == true
|
70
|
+
val = /^\s*([^:]*?)\s*:\s*(.*?)\s*$/.match(line)
|
71
|
+
repo[repo_key(strip(val[1]))] = strip(val[2])
|
72
|
+
end
|
71
73
|
end
|
74
|
+
@cache
|
72
75
|
end
|
73
|
-
@cache
|
74
|
-
end
|
75
76
|
|
76
|
-
|
77
|
-
|
78
|
-
|
77
|
+
def repos
|
78
|
+
repositories.map { |repo| repo['id'] }
|
79
|
+
end
|
79
80
|
|
80
|
-
|
81
|
-
|
82
|
-
|
81
|
+
def repo(repo)
|
82
|
+
YumRepo.new(self, repo)
|
83
|
+
end
|
83
84
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
85
|
+
# alias for yum.repo('reponame')
|
86
|
+
def method_missing(name)
|
87
|
+
repo(name.to_s) if !name.nil?
|
88
|
+
end
|
88
89
|
|
89
|
-
|
90
|
-
|
91
|
-
|
90
|
+
def to_s
|
91
|
+
'Yum Repository'
|
92
|
+
end
|
92
93
|
|
93
|
-
|
94
|
+
private
|
94
95
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
96
|
+
# Removes lefthand and righthand whitespace
|
97
|
+
def strip(value)
|
98
|
+
value.strip if !value.nil?
|
99
|
+
end
|
99
100
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
# Optimize the key value
|
102
|
+
def repo_key(key)
|
103
|
+
return key if key.nil?
|
104
|
+
key.gsub('Repo-', '').downcase
|
105
|
+
end
|
104
106
|
end
|
105
|
-
end
|
106
107
|
|
107
|
-
class YumRepo
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
108
|
+
class YumRepo
|
109
|
+
def initialize(yum, reponame)
|
110
|
+
@yum = yum
|
111
|
+
@reponame = reponame
|
112
|
+
end
|
112
113
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
114
|
+
# extracts the shortname from a repo id
|
115
|
+
# e.g. extras/7/x86_64 -> extras
|
116
|
+
def shortname(id)
|
117
|
+
val = %r{^\s*([^/]*?)/(.*?)\s*$}.match(id)
|
118
|
+
val.nil? ? nil : val[1]
|
119
|
+
end
|
119
120
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
121
|
+
def info
|
122
|
+
return @cache if defined?(@cache)
|
123
|
+
selection = @yum.repositories.select { |e| e['id'] == @reponame || shortname(e['id']) == @reponame }
|
124
|
+
@cache = selection[0] if !selection.nil? && selection.length == 1
|
125
|
+
@cache
|
126
|
+
end
|
126
127
|
|
127
|
-
|
128
|
-
|
129
|
-
|
128
|
+
def exist?
|
129
|
+
!info.nil?
|
130
|
+
end
|
130
131
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
132
|
+
def enabled?
|
133
|
+
repo = info
|
134
|
+
return false if repo.nil?
|
135
|
+
info['status'] == 'enabled'
|
136
|
+
end
|
135
137
|
end
|
136
|
-
end
|
137
138
|
|
138
|
-
# for compatability with serverspec
|
139
|
-
# this is deprecated syntax and will be removed in future versions
|
140
|
-
class YumRepoLegacy < Yum
|
141
|
-
|
139
|
+
# for compatability with serverspec
|
140
|
+
# this is deprecated syntax and will be removed in future versions
|
141
|
+
class YumRepoLegacy < Yum
|
142
|
+
name 'yumrepo'
|
142
143
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
144
|
+
def initialize(name)
|
145
|
+
super()
|
146
|
+
@repository = repo(name)
|
147
|
+
end
|
147
148
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
149
|
+
def exists?
|
150
|
+
deprecated
|
151
|
+
@repository.exist?
|
152
|
+
end
|
152
153
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
154
|
+
def enabled?
|
155
|
+
deprecated
|
156
|
+
@repository.enabled?
|
157
|
+
end
|
157
158
|
|
158
|
-
|
159
|
-
|
159
|
+
def deprecated
|
160
|
+
warn '[DEPRECATION] `yumrepo(reponame)` is deprecated. Please use `yum.repo(reponame)` instead.'
|
161
|
+
end
|
160
162
|
end
|
161
163
|
end
|