lib/rubix/models/host.rb in rubix-0.0.2 vs lib/rubix/models/host.rb in rubix-0.0.3

- old
+ new

@@ -47,14 +47,10 @@ :profile => host['profile'], :port => host['port'] }) end - def log_name - "HOST #{name || id}" - end - def self.id_field 'hostid' end # @@ -102,16 +98,15 @@ def update_request request('host.update', params.merge('hostid' => id)) end - def after_update + def before_update response = request('host.massUpdate', { 'groups' => host_group_params, 'templates' => template_params, 'macros' => user_macro_params, 'hosts' => [{'hostid' => id}]}) if response.has_data? - info("Updated templates, host groups, & macros") true else - error("Could not update all templates, host groups, and/or macros: #{response.error_message}") + error("Could not update all templates, host groups, and/or macros for #{resource_name}: #{response.error_message}") false end end def destroy_request