diff --git a/src/aare/daq/daq.py b/src/aare/daq/daq.py index 8722a01c..fbe3a0c5 100644 --- a/src/aare/daq/daq.py +++ b/src/aare/daq/daq.py @@ -875,7 +875,8 @@ class AareDAQ: self.__devs.tell.set_in_mount_position(True) previous_sample = self.__cfg.current_sample if target is None: - logger.debug(f"Unmounting sample: {previous_sample} (address: {previous_sample.tell_address()})") + if previous_sample is not None: + logger.debug(f"Unmounting sample: {previous_sample}") try: self.__devs.tell.unmount(wait=True, timeout=60.0) self.__cfg.current_sample = target @@ -885,9 +886,9 @@ class AareDAQ: try: #TODO: how to differentiate between mounting and unmounting fails # during a typucal mount call as this is handled by Tell? - log_msg = f"Mounting sample: {target} (address: {target.tell_address()})" + log_msg = f"Mounting sample: {target}" if previous_sample is not None: - log_msg = (f"Unmounting sample: {previous_sample} (address: {previous_sample.tell_address()})\n " + log_msg = (f"Unmounting sample: {previous_sample} \n " f"and {log_msg}") logger.debug(log_msg) value = self.__devs.tell.mount(address=target.tell_address(), force=True, auto_unmount=True, read_dm=False,