Config Conversion: Check that icinga.cfg is passed via -c option.

This commit is contained in:
Michael Friedrich 2013-09-10 11:25:10 +02:00
parent 61f0f7edc7
commit 4668f6fb3b
2 changed files with 7 additions and 2 deletions

View File

@ -46,7 +46,7 @@ sub get_key_from_icinga1_main_cfg {
my @key_arr = ();
if ( !-f $file) {
errlog(1, "cfg file $file does not exist!");
print "cfg file $file does not exist!";
return;
}

View File

@ -90,7 +90,7 @@ GetOptions(
"V|version" => \$opt->{version}
);
my $icinga1_cfg = "/etc/icinga/icinga.cfg";
my $icinga1_cfg;
my $icinga2_cfg = {};
my $conf_prefix = "./conf";
my $verbose = 1;
@ -138,6 +138,11 @@ my $type_cnt;
# TODO import/export files in parallel?
# verify that we have something to read
if ( !-f $icinga1_cfg) {
pod2usage(1);
}
# the import
my $icinga1_cfg_obj = Icinga2::ImportIcinga1Cfg::parse_icinga1_objects($icinga1_cfg);
my $icinga1_cfg_obj_cache = Icinga2::ImportIcinga1Cfg::parse_icinga1_objects_cache($icinga1_cfg);