return copy of entry from yaml dictionary
(cls, dic, key, mandatory=True)
| 1727 | |
| 1728 | @classmethod |
| 1729 | def _get_entry(cls, dic, key, mandatory=True): |
| 1730 | """return copy of entry from yaml dictionary""" |
| 1731 | if key not in dic: |
| 1732 | if mandatory: |
| 1733 | err = f'invalid config: no entry \"{key}\" found' |
| 1734 | raise YamlException(err) |
| 1735 | dic[key] = {} |
| 1736 | return deepcopy(dic[key]) |
| 1737 | if mandatory and not dic[key]: |
| 1738 | # ensure is not none |
| 1739 | dic[key] = {} |
| 1740 | return deepcopy(dic[key]) |
| 1741 | |
| 1742 | def _clear_none(self, dic): |
| 1743 | """recursively delete all none/empty values in a dictionary.""" |
no test coverage detected