def last_collection(self): if self.second_server_collect and not self.zone_collect: view = navigate_to(self.appliance.server, 'DiagnosticsCollectLogsSlave') else: view = navigate_to(self.obj_type, 'DiagnosticsCollectLogs') text = view.last_log_collection.text if text.lower() == "never": return None else: try: return parsetime.from_american_with_utc(text) except ValueError: return parsetime.from_iso_with_utc(text)
def last_collection(self): """ Returns: None if logs were not collected or :py:class`utils.timeutil.datetime()`, time were last collection took place """ if self.second_server_collect and not self.zone_collect: view = navigate_to(self, 'DiagnosticsCollectLogsSlave') else: view = navigate_to(self, 'DiagnosticsCollectLogs') text = view.last_log_collection.read() if text.lower() == "never": return None else: try: return parsetime.from_american_with_utc(text) except ValueError: return parsetime.from_iso_with_utc(text)