From 6809e7ea7fa6e5ede6d25de185fccadad7843eba Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Fri, 25 Aug 2023 08:41:30 +0100 Subject: [PATCH 1/2] config methods which do and do not return none --- spinnaker_graph_front_end/spinnaker.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spinnaker_graph_front_end/spinnaker.py b/spinnaker_graph_front_end/spinnaker.py index 160a8e10..a93f1ba5 100644 --- a/spinnaker_graph_front_end/spinnaker.py +++ b/spinnaker_graph_front_end/spinnaker.py @@ -13,7 +13,7 @@ # limitations under the License. import logging -from spinn_utilities.config_holder import get_config_str +from spinn_utilities.config_holder import is_config_none from spinn_utilities.log import FormatAdapter from spinn_front_end_common.data import FecDataView from spinn_front_end_common.interface.abstract_spinnaker_base import ( @@ -26,8 +26,10 @@ def _is_allocated_machine(): - return (get_config_str("Machine", "spalloc_server") or - get_config_str("Machine", "remote_spinnaker_url")) + if is_config_none("Machine", "spalloc_server"): + return not is_config_none(("Machine", "remote_spinnaker_url")) + else: + return True class SpiNNaker(AbstractSpinnakerBase): From 485ae67391dfa381acb39dad329ea92f0e230cad Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Fri, 25 Aug 2023 12:15:52 +0100 Subject: [PATCH 2/2] remove double bracket --- spinnaker_graph_front_end/spinnaker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spinnaker_graph_front_end/spinnaker.py b/spinnaker_graph_front_end/spinnaker.py index a93f1ba5..d7e3566f 100644 --- a/spinnaker_graph_front_end/spinnaker.py +++ b/spinnaker_graph_front_end/spinnaker.py @@ -27,7 +27,7 @@ def _is_allocated_machine(): if is_config_none("Machine", "spalloc_server"): - return not is_config_none(("Machine", "remote_spinnaker_url")) + return not is_config_none("Machine", "remote_spinnaker_url") else: return True