Fixed error in cli

(cherry picked from commit aebf32bbd1)
This commit is contained in:
m-lopez-f 2016-10-27 15:25:01 +02:00
parent 7650674043
commit f85253c5b7
1 changed files with 2 additions and 0 deletions

View File

@ -1239,10 +1239,12 @@ sub cli_create_data_module($) {
} }
if ($in_policy == 0) { if ($in_policy == 0) {
my $module_exists = get_agent_module_id($dbh, $module_name_def, $agent_id);
non_exist_check($module_exists, 'module name', $module_name_def); non_exist_check($module_exists, 'module name', $module_name_def);
print_log "[INFO] Adding module '$module_name' to agent '$agent_name'\n\n"; print_log "[INFO] Adding module '$module_name' to agent '$agent_name'\n\n";
} }
else { else {
my $policy_module_exist = enterprise_hook('get_policy_module_id',[$dbh, $policy_id, $module_name_def]);
non_exist_check($policy_module_exist,'policy module',$module_name_def); non_exist_check($policy_module_exist,'policy module',$module_name_def);
print_log "[INFO] Adding module '$module_name' to policy '$policy_name'\n\n"; print_log "[INFO] Adding module '$module_name' to policy '$policy_name'\n\n";
} }