File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 5
5
setcode do
6
6
apache_version = nil
7
7
8
- if Facter ::Util :: Resolution . which ( 'httpd' )
9
- apache_version = Facter ::Util :: Resolution . exec ( 'httpd -V 2>&1' )
8
+ if Facter ::Core :: Execution . which ( 'httpd' )
9
+ apache_version = Facter ::Core :: Execution . execute ( 'httpd -V 2>&1' )
10
10
Facter . debug "Matching httpd '#{ apache_version } '"
11
- elsif Facter ::Util :: Resolution . which ( 'apache2' )
12
- apache_version = Facter ::Util :: Resolution . exec ( 'apache2 -V 2>&1' )
11
+ elsif Facter ::Core :: Execution . which ( 'apache2' )
12
+ apache_version = Facter ::Core :: Execution . execute ( 'apache2 -V 2>&1' )
13
13
Facter . debug "Matching apache2 '#{ apache_version } '"
14
- elsif Facter ::Util :: Resolution . which ( 'apachectl' )
15
- apache_version = Facter ::Util :: Resolution . exec ( 'apachectl -v 2>&1' )
14
+ elsif Facter ::Core :: Execution . which ( 'apachectl' )
15
+ apache_version = Facter ::Core :: Execution . execute ( 'apachectl -v 2>&1' )
16
16
Facter . debug "Matching apachectl '#{ apache_version } '"
17
- elsif Facter ::Util :: Resolution . which ( 'apache2ctl' )
18
- apache_version = Facter ::Util :: Resolution . exec ( 'apache2ctl -v 2>&1' )
17
+ elsif Facter ::Core :: Execution . which ( 'apache2ctl' )
18
+ apache_version = Facter ::Core :: Execution . execute ( 'apache2ctl -v 2>&1' )
19
19
Facter . debug "Matching apache2ctl '#{ apache_version } '"
20
20
end
21
21
Original file line number Diff line number Diff line change 10
10
context 'with value' do
11
11
before :each do
12
12
allow ( Facter . fact ( :kernel ) ) . to receive ( :value ) . and_return ( 'Linux' )
13
- expect ( Facter ::Util :: Resolution ) . to receive ( :which ) . with ( 'httpd' ) { true }
14
- expect ( Facter ::Util :: Resolution ) . to receive ( :exec ) . with ( 'httpd -V 2>&1' ) {
13
+ expect ( Facter ::Core :: Execution ) . to receive ( :which ) . with ( 'httpd' ) { true }
14
+ expect ( Facter ::Core :: Execution ) . to receive ( :execute ) . with ( 'httpd -V 2>&1' ) {
15
15
'Server version: Apache/2.4.16 (Unix)
16
16
Server built: Jul 31 2015 15:53:26'
17
17
}
26
26
context 'with value' do
27
27
before :each do
28
28
allow ( Facter . fact ( :kernel ) ) . to receive ( :value ) . and_return ( 'Linux' )
29
- expect ( Facter ::Util :: Resolution ) . to receive ( :which ) . with ( 'httpd' ) { true }
30
- expect ( Facter ::Util :: Resolution ) . to receive ( :exec ) . with ( 'httpd -V 2>&1' ) {
29
+ expect ( Facter ::Core :: Execution ) . to receive ( :which ) . with ( 'httpd' ) { true }
30
+ expect ( Facter ::Core :: Execution ) . to receive ( :execute ) . with ( 'httpd -V 2>&1' ) {
31
31
'Server version: Apache/2.4.6 ()
32
32
Server built: Nov 21 2015 05:34:59'
33
33
}
You can’t perform that action at this time.
0 commit comments