Skip to content

Commit

Permalink
Merge pull request #12561 from tzumainn/network-crud-logs
Browse files Browse the repository at this point in the history
Add logs for network and subnet CRUD
(cherry picked from commit a2f25f3)

https://bugzilla.redhat.com/show_bug.cgi?id=1393959
  • Loading branch information
agrare authored and chessbyte committed Nov 11, 2016
1 parent e6937af commit cd53b3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Expand Up @@ -10,6 +10,8 @@ def self.remapping(options)
end

def self.raw_create_network(ext_management_system, options)
# TODO: remove this log line once this uses the task queue, as the task queue has its own logging
_log.info "Command: #{self.class.name}##{__method__}, Args: #{options.inspect}"
cloud_tenant = options.delete(:cloud_tenant)
network = nil
raw_options = remapping(options)
Expand All @@ -32,6 +34,8 @@ def provider_object(connection)
end

def raw_delete_network
# TODO: remove this log line once this uses the task queue, as the task queue has its own logging
_log.info "Command: #{self.class.name}##{__method__}, ID: #{id}"
with_provider_object(&:destroy)
destroy!
rescue => e
Expand All @@ -40,6 +44,8 @@ def raw_delete_network
end

def raw_update_network(options)
# TODO: remove this log line once this uses the task queue, as the task queue has its own logging
_log.info "Command: #{self.class.name}##{__method__}, ID: #{id}, Args: #{options.inspect}"
with_provider_object do |network|
network.attributes.merge!(options)
network.save
Expand Down
@@ -1,5 +1,7 @@
class ManageIQ::Providers::Openstack::NetworkManager::CloudSubnet < ::CloudSubnet
def self.raw_create_subnet(ext_management_system, options)
# TODO: remove this log line once this uses the task queue, as the task queue has its own logging
_log.info "Command: #{self.class.name}##{__method__}, Args: #{options.inspect}"
cloud_tenant = options.delete(:cloud_tenant)
subnet = nil

Expand All @@ -22,6 +24,8 @@ def provider_object(connection)
end

def raw_delete_subnet
# TODO: remove this log line once this uses the task queue, as the task queue has its own logging
_log.info "Command: #{self.class.name}##{__method__}, ID: #{id}"
with_provider_object(&:destroy)
destroy!
rescue => e
Expand All @@ -30,6 +34,8 @@ def raw_delete_subnet
end

def raw_update_subnet(options)
# TODO: remove this log line once this uses the task queue, as the task queue has its own logging
_log.info "Command: #{self.class.name}##{__method__}, ID: #{id}, Args: #{options.inspect}"
with_provider_object do |subnet|
subnet.attributes.merge!(options)
subnet.save
Expand Down

0 comments on commit cd53b3d

Please sign in to comment.