Title: [opsview] [11844] Merge from commercial, cleaning up ref attributes
- Revision
- 11844
- Author
- tvoon
- Date
- 2013-03-18 15:13:37 +0000 (Mon, 18 Mar 2013)
Log Message
Merge from commercial, cleaning up ref attributes
Modified Paths
Modified: trunk/opsview-core/utils/parse_config_json
===================================================================
--- trunk/opsview-core/utils/parse_config_json 2013-03-18 15:08:33 UTC (rev 11843)
+++ trunk/opsview-core/utils/parse_config_json 2013-03-18 15:13:37 UTC (rev 11844)
@@ -37,6 +37,7 @@
use Data::Dump qw(dump);
use JSON;
use Getopt::Long;
+use Opsview::Utils;
my $opspacks_dir = "/usr/local/nagios/import/opspacks_source";
@@ -83,10 +84,14 @@
delete $config->{keyword};
- foreach my $s ( @{ $config->{servicecheck} } ) {
- delete $s->{keywords};
+ if ( $config->{servicecheck} ) {
+ foreach my $s ( @{ $config->{servicecheck} } ) {
+ delete $s->{keywords};
+ }
}
+ Opsview::Utils->remove_keys_from_hash( $config, ["ref"] );
+
open F, ">", $json_file or die "Cannot write to $json_file";
print F $j->canonical->pretty->encode($config);
close F;
_______________________________________________
Opsview-checkins mailing list
Opsview-checkins@lists.opsview.org
http://lists.opsview.org/lists/listinfo/opsview-checkins