drive-audit: Simplify handling of log udp options
log_udp_port is ignored when log_udp_host is not set, so we don't have to explicitly drop log_udp_port according to log_udp_host. Change-Id: I728212bf8d52728dc5eb5aefe77ed2844a55084e
This commit is contained in:
		@@ -47,11 +47,11 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# [*log_udp_host*]
 | 
					# [*log_udp_host*]
 | 
				
			||||||
#   (Optional) If not set, the UDP receiver for syslog is disabled.
 | 
					#   (Optional) If not set, the UDP receiver for syslog is disabled.
 | 
				
			||||||
#   Defaults to undef.
 | 
					#   Defaults to $facts['os_service_default'].
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# [*log_udp_port*]
 | 
					# [*log_udp_port*]
 | 
				
			||||||
#   (Optional) Port value for UDP receiver, if enabled.
 | 
					#   (Optional) Port value for UDP receiver, if enabled.
 | 
				
			||||||
#   Defaults to undef.
 | 
					#   Defaults to $facts['os_service_default'].
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# [*log_max_line_length*]
 | 
					# [*log_max_line_length*]
 | 
				
			||||||
#   (Optional) Caps the length of log lines to the value given.
 | 
					#   (Optional) Caps the length of log lines to the value given.
 | 
				
			||||||
@@ -114,8 +114,8 @@ class swift::storage::drive_audit(
 | 
				
			|||||||
  $log_level                                = 'INFO',
 | 
					  $log_level                                = 'INFO',
 | 
				
			||||||
  $log_address                              = '/dev/log',
 | 
					  $log_address                              = '/dev/log',
 | 
				
			||||||
  $log_name                                 = 'drive-audit',
 | 
					  $log_name                                 = 'drive-audit',
 | 
				
			||||||
  $log_udp_host                             = undef,
 | 
					  $log_udp_host                             = $facts['os_service_default'],
 | 
				
			||||||
  $log_udp_port                             = undef,
 | 
					  $log_udp_port                             = $facts['os_service_default'],
 | 
				
			||||||
  $log_max_line_length                      = $facts['os_service_default'],
 | 
					  $log_max_line_length                      = $facts['os_service_default'],
 | 
				
			||||||
  $device_dir                               = '/srv/node',
 | 
					  $device_dir                               = '/srv/node',
 | 
				
			||||||
  $minutes                                  = $facts['os_service_default'],
 | 
					  $minutes                                  = $facts['os_service_default'],
 | 
				
			||||||
@@ -152,18 +152,8 @@ class swift::storage::drive_audit(
 | 
				
			|||||||
    'drive-audit/log_level'           : value => $log_level;
 | 
					    'drive-audit/log_level'           : value => $log_level;
 | 
				
			||||||
    'drive-audit/log_address'         : value => $log_address;
 | 
					    'drive-audit/log_address'         : value => $log_address;
 | 
				
			||||||
    'drive-audit/log_max_line_length' : value => $log_max_line_length;
 | 
					    'drive-audit/log_max_line_length' : value => $log_max_line_length;
 | 
				
			||||||
  }
 | 
					    'drive-audit/log_udp_host'        : value => $log_udp_host;
 | 
				
			||||||
 | 
					    'drive-audit/log_udp_port'        : value => $log_udp_port;
 | 
				
			||||||
  if $log_udp_host {
 | 
					 | 
				
			||||||
    swift_drive_audit_config {
 | 
					 | 
				
			||||||
      'drive-audit/log_udp_host': value => $log_udp_host;
 | 
					 | 
				
			||||||
      'drive-audit/log_udp_port': value => pick($log_udp_port, $facts['os_service_default']);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  } else {
 | 
					 | 
				
			||||||
    swift_drive_audit_config {
 | 
					 | 
				
			||||||
      'drive-audit/log_udp_host': value => $facts['os_service_default'];
 | 
					 | 
				
			||||||
      'drive-audit/log_udp_port': value => $facts['os_service_default'];
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  swift_drive_audit_config {
 | 
					  swift_drive_audit_config {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user