Skip to content

Commit

Permalink
Fixing subtle bug where MysqlCookbook::Helper methods were polluting …
Browse files Browse the repository at this point in the history
…Chef::Resource
  • Loading branch information
Sean OMeara committed Dec 27, 2014
1 parent 97ccec4 commit 93d6467
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
11 changes: 5 additions & 6 deletions libraries/resource_mysql_client.rb
@@ -1,5 +1,4 @@
require 'chef/resource/lwrp_base'
require_relative 'helpers'

class Chef
class Resource
Expand All @@ -12,13 +11,13 @@ class MysqlClient < Chef::Resource::LWRPBase
attribute :package_name, kind_of: Array, default: nil
attribute :package_version, kind_of: String, default: nil
attribute :version, kind_of: String, default: nil # mysql_version
end

include MysqlCookbook::Helpers
include MysqlCookbook::Helpers

def client_package_name
return package_name if package_name
client_package
def client_package_name
return package_name if package_name
client_package
end
end
end
end
5 changes: 2 additions & 3 deletions libraries/resource_mysql_config.rb
@@ -1,5 +1,4 @@
require 'chef/resource/lwrp_base'
require_relative 'helpers'

class Chef
class Resource
Expand All @@ -16,8 +15,8 @@ class MysqlConfig < Chef::Resource::LWRPBase
attribute :source, kind_of: String, default: nil
attribute :variables, kind_of: [Hash], default: nil
attribute :version, kind_of: String, default: nil
end

include MysqlCookbook::Helpers
include MysqlCookbook::Helpers
end
end
end
11 changes: 5 additions & 6 deletions libraries/resource_mysql_service.rb
@@ -1,5 +1,4 @@
require 'chef/resource/lwrp_base'
require_relative 'helpers'

class Chef
class Resource
Expand All @@ -20,13 +19,13 @@ class MysqlService < Chef::Resource::LWRPBase
attribute :run_group, kind_of: String, default: 'mysql'
attribute :run_user, kind_of: String, default: 'mysql'
attribute :version, kind_of: String, default: nil
end

include MysqlCookbook::Helpers
include MysqlCookbook::Helpers

def server_package_name
return package_name if package_name
server_package
def server_package_name
return package_name if package_name
server_package
end
end
end
end

0 comments on commit 93d6467

Please sign in to comment.