Feature/dbbkupsw 1900#356
Conversation
| if map_file: | ||
| ca_file = key_file = crl_file= ciphers = None | ||
| config = ConfigObj(map_file) | ||
| mapper = config["CREDENTIALS"]["kafka_server"] |
There was a problem hiding this comment.
this syntax results in KeyError if CREDENTIALS or kafka_server not present in mapper file.
use like this.
if "CREDENTIALS" not in config and "kafka_server" not in config["CREDENTIALS"]:
return False
mapper = config["CREDENTIALS"]["kafka_server"]
status, mapper_data = Utils.data_Utils.replace_var(mapper, {}, {})
return status if not status
kafka_ip = config["CREDENTIALS"]["kafka_server"].get("kafka_host", None)
kafka_port = config["CREDENTIALS"]["kafka_server"].get("kafka_port", None)
ca_file = config["CREDENTIALS"]["kafka_server"].get("ca_file", None)
key_file = config["CREDENTIALS"]["kafka_server"]("key_file", None)
crl_file = config["CREDENTIALS"]["kafka_server"]("crl_file", None)
ciphers = config["CREDENTIALS"]["kafka_server"]("ciphers", None)
| i = i.replace('\n', '') | ||
| i = i.strip() | ||
| valid = re.search(i, reply) | ||
| if valid is None and match_type == 'AND': |
There was a problem hiding this comment.
this can be written in single if statement as content in both 'if' and 'else' is same.
if (not valid and match_type == 'AND) or (valid and match_type != 'AND'):
result = not result
break
| elif valid is not None and match_type != 'AND': | ||
| result = not result | ||
| break | ||
| if result and match_type == 'NOT': |
There was a problem hiding this comment.
same comment as above
ryadaval-warrior
left a comment
There was a problem hiding this comment.
Given some minor comments.
No description provided.