Skip to content

Commit ff4028b

Browse files
committed
(CONT-173) - Updating deprecated facter instances
Prior to this PR, this module contained instances of Facter::Util::Resolution.exec and Facter::Util::Resolution.which, which are deprecated. This PR aims to replace these exec helpers with their supported Facter::Core::Execution counterparts. This PR: Replaces all Facter::Util::Resolution instances with corresponding Facter::Core::Execution exec helpers
1 parent 0b1f9b3 commit ff4028b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/facter/mysql_version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Facter.add('mysql_version') do
44
confine { Facter::Core::Execution.which('mysql') }
55
setcode do
6-
mysql_ver = Facter::Util::Resolution.exec('mysql --version')
6+
mysql_ver = Facter::Core::Execution.execute('mysql --version')
77
mysql_ver.match(%r{\d+\.\d+\.\d+})[0] if mysql_ver
88
end
99
end

lib/facter/mysqld_version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Facter.add('mysqld_version') do
44
confine { Facter::Core::Execution.which('mysqld') }
55
setcode do
6-
Facter::Util::Resolution.exec('mysqld --no-defaults -V 2>/dev/null')
6+
Facter::Core::Execution.execute('mysqld --no-defaults -V 2>/dev/null')
77
end
88
end

spec/unit/facter/mysql_version_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
context 'with value' do
1212
before :each do
1313
allow(Facter::Core::Execution).to receive(:which).and_return('fake_mysql_path')
14-
allow(Facter::Util::Resolution).to receive(:exec).with('mysql --version').and_return('mysql Ver 14.12 Distrib 5.0.95, for redhat-linux-gnu (x86_64) using readline 5.1')
14+
allow(Facter::Core::Execution).to receive(:execute).with('mysql --version').and_return('mysql Ver 14.12 Distrib 5.0.95, for redhat-linux-gnu (x86_64) using readline 5.1')
1515
end
1616
it {
1717
expect(Facter.fact(:mysql_version).value).to eq('5.0.95')

spec/unit/facter/mysqld_version_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
context 'with value' do
1212
before :each do
1313
allow(Facter::Core::Execution).to receive(:which).with('mysqld').and_return('/usr/sbin/mysqld')
14-
allow(Facter::Util::Resolution).to receive(:exec).with('mysqld --no-defaults -V 2>/dev/null')
15-
.and_return('mysqld Ver 5.5.49-37.9 for Linux on x86_64 (Percona Server (GPL), Release 37.9, Revision efa0073)')
14+
allow(Facter::Core::Execution).to receive(:execute).with('mysqld --no-defaults -V 2>/dev/null')
15+
.and_return('mysqld Ver 5.5.49-37.9 for Linux on x86_64 (Percona Server (GPL), Release 37.9, Revision efa0073)')
1616
end
1717
it {
1818
expect(Facter.fact(:mysqld_version).value).to eq('mysqld Ver 5.5.49-37.9 for Linux on x86_64 (Percona Server (GPL), Release 37.9, Revision efa0073)')

0 commit comments

Comments
 (0)