Add limit to mysql server ID generated value

This commit is contained in:
Quentin Moss 2016-08-09 16:39:30 -07:00
parent 86712c02de
commit 8d4b83159e
No known key found for this signature in database
GPG key ID: E17DF46851B25AE2
2 changed files with 2 additions and 2 deletions

View file

@ -1,5 +1,5 @@
def get_mysql_id def get_mysql_id
Facter.value(:macaddress).split(':').inject(0) { |total,value| (total << 6) + value.hex } Facter.value(:macaddress).split(':')[2..-1].inject(0) { |total,value| (total << 6) + value.hex }
end end
Facter.add("mysql_server_id") do Facter.add("mysql_server_id") do

View file

@ -11,7 +11,7 @@ describe Facter::Util::Fact do
Facter.fact(:macaddress).stubs(:value).returns('3c:97:0e:69:fb:e1') Facter.fact(:macaddress).stubs(:value).returns('3c:97:0e:69:fb:e1')
end end
it do it do
Facter.fact(:mysql_server_id).value.to_s.should == '66961985441' Facter.fact(:mysql_server_id).value.to_s.should == '4116385'
end end
end end