Initialize the object with the necessary database configurations
(self, mongo_connector, alternative_collection=None)
| 45 | return logging.getLogger(__name__) |
| 46 | |
| 47 | def __init__(self, mongo_connector, alternative_collection=None): |
| 48 | """ |
| 49 | Initialize the object with the necessary database configurations |
| 50 | """ |
| 51 | self._logger = self._log() |
| 52 | self._mongo_connector = mongo_connector |
| 53 | if alternative_collection is not None: |
| 54 | try: |
| 55 | self.all_dns_collection = getattr( |
| 56 | mongo_connector, alternative_collection |
| 57 | )() |
| 58 | except: |
| 59 | self._logger.error( |
| 60 | "FATAL: Could not fetch dynamic collection in DNS Manager" |
| 61 | ) |
| 62 | exit(1) |
| 63 | else: |
| 64 | self.all_dns_collection = mongo_connector.get_all_dns_connection() |
| 65 | |
| 66 | @staticmethod |
| 67 | def monthdelta(date, delta): |
nothing calls this directly
no test coverage detected