Why do I get “Error while executing a rule—AttributeError: ‘NoneType’ object has no attribute ‘get’” when executing the below. The error triggers on cluster_name
cluster_cmd := discovery.fileGet(host, "/%install_root%/config/server.cnf");
if cluster_cmd <> "" then
log.debug("Found server.cnf file"); //Try to extract cluster and alias name
cluster_name := regex.extract(cluster_cmd.content, regex'cacheName=(\S+)', raw'\1');
if not cluster_name then
log.debug("This is no cluster");
else
log.debug("Cluster identified as %cluster_name%");
cluster_name := cluster_name;
cluster_alias := regex.extract(cluster_cmd.content, regex'aliasList=(\S+)', raw'\1');
if cluster_alias <> "" then
cluster_alias := cluster_alias;
end if;
end if;
end if;
I guess it is triggered because the cacheName attribute is not found in the file, but how do I remedy this? If the attribute exists, the code works.
