Skip to content

Commit

Permalink
Add limit to mysql server ID generated value
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinMoss committed Aug 10, 2016
1 parent 86712c0 commit 8d4b831
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/facter/mysql_server_id.rb
@@ -1,5 +1,5 @@
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

Facter.add("mysql_server_id") do
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/facter/mysql_server_id_spec.rb
Expand Up @@ -11,7 +11,7 @@
Facter.fact(:macaddress).stubs(:value).returns('3c:97:0e:69:fb:e1')
end
it do
Facter.fact(:mysql_server_id).value.to_s.should == '66961985441'
Facter.fact(:mysql_server_id).value.to_s.should == '4116385'
end
end

Expand Down

0 comments on commit 8d4b831

Please sign in to comment.