From 35a9a0a0583f179e0895525d9ba2a442183ee7ca Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 4 Mar 2019 15:52:00 +0100 Subject: [PATCH 01/11] Check for IP addresses used as network keys Contributes to CL-1266 --- .../src/Cloud/CloudOutputDevice.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index 7b5add276a..b89fc9d61d 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -140,9 +140,17 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice): ## Checks whether the given network key is found in the cloud's host name def matchesNetworkKey(self, network_key: str) -> bool: - # A network key looks like "ultimakersystem-aabbccdd0011._ultimaker._tcp.local." + # Typically, a network key looks like "ultimakersystem-aabbccdd0011._ultimaker._tcp.local." # the host name should then be "ultimakersystem-aabbccdd0011" - return network_key.startswith(self.clusterData.host_name) + if network_key.startswith(self.clusterData.host_name): + return True + + # However, for manually added printers, the local IP address is used in lieu of a proper + # network key, so check for that as well + if network_key == self.clusterData.host_internal_ip: + return True + + return False ## Set all the interface elements and texts for this output device. def _setInterfaceElements(self) -> None: From 63bf95cc9e29cb3d306bcdb4d8837e10aa8bfcd3 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 4 Mar 2019 16:26:20 +0100 Subject: [PATCH 02/11] More robust check for network key Contributes to CL-1266 --- plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index b89fc9d61d..f78f5e91c0 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -147,7 +147,7 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice): # However, for manually added printers, the local IP address is used in lieu of a proper # network key, so check for that as well - if network_key == self.clusterData.host_internal_ip: + if network_key.find(self.clusterData.host_internal_ip): return True return False From 04a2caf7815d72888cf41993d0e6f890504925dd Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Mon, 4 Mar 2019 16:29:23 +0100 Subject: [PATCH 03/11] Add internal IP to CloudClusterResponse Contributes to CL-1266 --- .../src/Cloud/Models/CloudClusterResponse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py index 9c0853e7c9..f071c61f67 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py @@ -16,13 +16,14 @@ class CloudClusterResponse(BaseCloudModel): # \param status: The status of the cluster authentication (active or inactive). # \param host_version: The firmware version of the cluster host. This is where the Stardust client is running on. def __init__(self, cluster_id: str, host_guid: str, host_name: str, is_online: bool, status: str, - host_version: Optional[str] = None, **kwargs) -> None: + host_internal_ip: str, host_version: Optional[str] = None, **kwargs) -> None: self.cluster_id = cluster_id self.host_guid = host_guid self.host_name = host_name self.status = status self.is_online = is_online self.host_version = host_version + self.host_internal_ip = host_internal_ip super().__init__(**kwargs) # Validates the model, raising an exception if the model is invalid. From d758189aafe809397a6caa9616a09e41bb5ef251 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 5 Mar 2019 09:28:18 +0100 Subject: [PATCH 04/11] Adapt tests to manual IP connection Contributes to CL-1266 --- .../tests/Cloud/TestCloudOutputDevice.py | 12 ++++++++++-- .../tests/Cloud/TestCloudOutputDeviceManager.py | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDevice.py b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDevice.py index c4d891302e..6ba6436694 100644 --- a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDevice.py @@ -22,6 +22,7 @@ class TestCloudOutputDevice(TestCase): HOST_NAME = "ultimakersystem-ccbdd30044ec" HOST_GUID = "e90ae0ac-1257-4403-91ee-a44c9b7e8050" HOST_VERSION = "5.2.0" + HOST_INTERNAL_IP = "10.183.0.139" STATUS_URL = "{}/connect/v1/clusters/{}/status".format(CuraCloudAPIRoot, CLUSTER_ID) PRINT_URL = "{}/connect/v1/clusters/{}/print/{}".format(CuraCloudAPIRoot, CLUSTER_ID, JOB_ID) @@ -36,8 +37,15 @@ class TestCloudOutputDevice(TestCase): for patched_method in self.patches: patched_method.start() - self.cluster = CloudClusterResponse(self.CLUSTER_ID, self.HOST_GUID, self.HOST_NAME, is_online=True, - status="active", host_version=self.HOST_VERSION) + self.cluster = CloudClusterResponse( + self.CLUSTER_ID, + self.HOST_GUID, + self.HOST_NAME, + is_online=True, + status="active", + host_internal_ip=self.HOST_INTERNAL_IP, + host_version=self.HOST_VERSION + ) self.network = NetworkManagerMock() self.account = MagicMock(isLoggedIn=True, accessToken="TestAccessToken") diff --git a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py index e24ca1694e..b34943c613 100644 --- a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py @@ -113,6 +113,20 @@ class TestCloudOutputDeviceManager(TestCase): active_machine_mock.setMetaDataEntry.assert_called_with("um_cloud_cluster_id", cluster2["cluster_id"]) + def test_device_connects_by_local_ip_address(self): + active_machine_mock = self.app.getGlobalContainerStack.return_value + + cluster1, cluster2 = self.clusters_response["data"] + network_key = cluster2["host_internal_ip"] + active_machine_mock.getMetaDataEntry.side_effect = {"um_network_key": network_key}.get + + self._loadData() + + self.assertIsNone(self.device_manager.getOutputDevice(cluster1["cluster_id"])) + self.assertTrue(self.device_manager.getOutputDevice(cluster2["cluster_id"]).isConnected()) + + active_machine_mock.setMetaDataEntry.assert_called_with("um_cloud_cluster_id", cluster2["cluster_id"]) + @patch.object(CloudOutputDeviceManager, "Message") def test_api_error(self, message_mock): self.clusters_response = { From f483eb431f9192026be348a672cb38c5337db328 Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Tue, 5 Mar 2019 09:30:51 +0100 Subject: [PATCH 05/11] Make IP address optional Contribues to CL-1266 --- .../UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py index f071c61f67..6e49e9e2a9 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py @@ -16,7 +16,7 @@ class CloudClusterResponse(BaseCloudModel): # \param status: The status of the cluster authentication (active or inactive). # \param host_version: The firmware version of the cluster host. This is where the Stardust client is running on. def __init__(self, cluster_id: str, host_guid: str, host_name: str, is_online: bool, status: str, - host_internal_ip: str, host_version: Optional[str] = None, **kwargs) -> None: + host_internal_ip: Optional[str], host_version: Optional[str] = None, **kwargs) -> None: self.cluster_id = cluster_id self.host_guid = host_guid self.host_name = host_name From c9d99e01498c6be342c9a7d2c50902e543b3e1fd Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Wed, 6 Mar 2019 13:11:43 +0100 Subject: [PATCH 06/11] Revert "Adapt tests to manual IP connection" This reverts commit d758189aafe809397a6caa9616a09e41bb5ef251. --- .../tests/Cloud/TestCloudOutputDevice.py | 12 ++---------- .../tests/Cloud/TestCloudOutputDeviceManager.py | 14 -------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDevice.py b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDevice.py index 6ba6436694..c4d891302e 100644 --- a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDevice.py @@ -22,7 +22,6 @@ class TestCloudOutputDevice(TestCase): HOST_NAME = "ultimakersystem-ccbdd30044ec" HOST_GUID = "e90ae0ac-1257-4403-91ee-a44c9b7e8050" HOST_VERSION = "5.2.0" - HOST_INTERNAL_IP = "10.183.0.139" STATUS_URL = "{}/connect/v1/clusters/{}/status".format(CuraCloudAPIRoot, CLUSTER_ID) PRINT_URL = "{}/connect/v1/clusters/{}/print/{}".format(CuraCloudAPIRoot, CLUSTER_ID, JOB_ID) @@ -37,15 +36,8 @@ class TestCloudOutputDevice(TestCase): for patched_method in self.patches: patched_method.start() - self.cluster = CloudClusterResponse( - self.CLUSTER_ID, - self.HOST_GUID, - self.HOST_NAME, - is_online=True, - status="active", - host_internal_ip=self.HOST_INTERNAL_IP, - host_version=self.HOST_VERSION - ) + self.cluster = CloudClusterResponse(self.CLUSTER_ID, self.HOST_GUID, self.HOST_NAME, is_online=True, + status="active", host_version=self.HOST_VERSION) self.network = NetworkManagerMock() self.account = MagicMock(isLoggedIn=True, accessToken="TestAccessToken") diff --git a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py index b34943c613..e24ca1694e 100644 --- a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py @@ -113,20 +113,6 @@ class TestCloudOutputDeviceManager(TestCase): active_machine_mock.setMetaDataEntry.assert_called_with("um_cloud_cluster_id", cluster2["cluster_id"]) - def test_device_connects_by_local_ip_address(self): - active_machine_mock = self.app.getGlobalContainerStack.return_value - - cluster1, cluster2 = self.clusters_response["data"] - network_key = cluster2["host_internal_ip"] - active_machine_mock.getMetaDataEntry.side_effect = {"um_network_key": network_key}.get - - self._loadData() - - self.assertIsNone(self.device_manager.getOutputDevice(cluster1["cluster_id"])) - self.assertTrue(self.device_manager.getOutputDevice(cluster2["cluster_id"]).isConnected()) - - active_machine_mock.setMetaDataEntry.assert_called_with("um_cloud_cluster_id", cluster2["cluster_id"]) - @patch.object(CloudOutputDeviceManager, "Message") def test_api_error(self, message_mock): self.clusters_response = { From 637e18a841067e8681e283ed6dd281dc435ff5ae Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Wed, 27 Mar 2019 15:40:06 +0100 Subject: [PATCH 07/11] Add default value for internal IP if not supplied Contributes to CL-1266 --- .../UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py index 6e49e9e2a9..207d0bffa9 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py @@ -16,7 +16,7 @@ class CloudClusterResponse(BaseCloudModel): # \param status: The status of the cluster authentication (active or inactive). # \param host_version: The firmware version of the cluster host. This is where the Stardust client is running on. def __init__(self, cluster_id: str, host_guid: str, host_name: str, is_online: bool, status: str, - host_internal_ip: Optional[str], host_version: Optional[str] = None, **kwargs) -> None: + host_internal_ip: Optional[str] = "", host_version: Optional[str] = None, **kwargs) -> None: self.cluster_id = cluster_id self.host_guid = host_guid self.host_name = host_name From 4581c1f1384dc4842faeb99a4a0355c375d4f55f Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Thu, 28 Mar 2019 16:20:01 +0100 Subject: [PATCH 08/11] Fix UM3NetworkPrinting test Contributes to CL-1266 --- .../UM3NetworkPrinting/tests/Cloud/Fixtures/getClusters.json | 2 ++ .../tests/Cloud/TestCloudOutputDeviceManager.py | 2 +- plugins/UM3NetworkPrinting/tests/TestSendMaterialJob.py | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/tests/Cloud/Fixtures/getClusters.json b/plugins/UM3NetworkPrinting/tests/Cloud/Fixtures/getClusters.json index 5200e3b971..a749721518 100644 --- a/plugins/UM3NetworkPrinting/tests/Cloud/Fixtures/getClusters.json +++ b/plugins/UM3NetworkPrinting/tests/Cloud/Fixtures/getClusters.json @@ -4,6 +4,7 @@ "host_guid": "e90ae0ac-1257-4403-91ee-a44c9b7e8050", "host_name": "ultimakersystem-ccbdd30044ec", "host_version": "5.0.0.20170101", + "host_internal_ip": "", "is_online": true, "status": "active" }, { @@ -11,6 +12,7 @@ "host_guid": "e0ace90a-91ee-1257-4403-e8050a44c9b7", "host_name": "ultimakersystem-30044ecccbdd", "host_version": "5.1.2.20180807", + "host_internal_ip": "", "is_online": true, "status": "active" }] diff --git a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py index e24ca1694e..ff7c6b2b67 100644 --- a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py @@ -97,7 +97,7 @@ class TestCloudOutputDeviceManager(TestCase): self.assertTrue(self.device_manager.getOutputDevice(cluster1["cluster_id"]).isConnected()) self.assertIsNone(self.device_manager.getOutputDevice(cluster2["cluster_id"])) - self.assertEquals([], active_machine_mock.setMetaDataEntry.mock_calls) + self.assertEqual([], active_machine_mock.setMetaDataEntry.mock_calls) def test_device_connects_by_network_key(self): active_machine_mock = self.app.getGlobalContainerStack.return_value diff --git a/plugins/UM3NetworkPrinting/tests/TestSendMaterialJob.py b/plugins/UM3NetworkPrinting/tests/TestSendMaterialJob.py index 952d38dcf4..2cab110861 100644 --- a/plugins/UM3NetworkPrinting/tests/TestSendMaterialJob.py +++ b/plugins/UM3NetworkPrinting/tests/TestSendMaterialJob.py @@ -208,7 +208,7 @@ class TestSendMaterialJob(TestCase): self.assertEqual(1, device_mock.createFormPart.call_count) self.assertEqual(1, device_mock.postFormWithParts.call_count) - self.assertEquals( + self.assertEqual( [call.createFormPart("name=\"file\"; filename=\"generic_pla_white.xml.fdm_material\"", ""), call.postFormWithParts(target = "materials/", parts = ["_xXx_"], on_finished = job.sendingFinished)], device_mock.method_calls) @@ -238,7 +238,7 @@ class TestSendMaterialJob(TestCase): self.assertEqual(1, device_mock.createFormPart.call_count) self.assertEqual(1, device_mock.postFormWithParts.call_count) - self.assertEquals( + self.assertEqual( [call.createFormPart("name=\"file\"; filename=\"generic_pla_white.xml.fdm_material\"", ""), call.postFormWithParts(target = "materials/", parts = ["_xXx_"], on_finished = job.sendingFinished)], device_mock.method_calls) From 58f1c055647c35f0c4d67389ad402f8f320def9d Mon Sep 17 00:00:00 2001 From: Ian Paschal Date: Fri, 29 Mar 2019 12:27:58 +0100 Subject: [PATCH 09/11] Actually fix tests Contributes to CL-1266 --- .../src/Cloud/Models/CloudClusterResponse.py | 2 +- .../UM3NetworkPrinting/tests/Cloud/Fixtures/getClusters.json | 2 -- .../tests/Cloud/TestCloudOutputDeviceManager.py | 5 ++++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py index 207d0bffa9..48a4d5f031 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/Models/CloudClusterResponse.py @@ -16,7 +16,7 @@ class CloudClusterResponse(BaseCloudModel): # \param status: The status of the cluster authentication (active or inactive). # \param host_version: The firmware version of the cluster host. This is where the Stardust client is running on. def __init__(self, cluster_id: str, host_guid: str, host_name: str, is_online: bool, status: str, - host_internal_ip: Optional[str] = "", host_version: Optional[str] = None, **kwargs) -> None: + host_internal_ip: Optional[str] = None, host_version: Optional[str] = None, **kwargs) -> None: self.cluster_id = cluster_id self.host_guid = host_guid self.host_name = host_name diff --git a/plugins/UM3NetworkPrinting/tests/Cloud/Fixtures/getClusters.json b/plugins/UM3NetworkPrinting/tests/Cloud/Fixtures/getClusters.json index a749721518..5200e3b971 100644 --- a/plugins/UM3NetworkPrinting/tests/Cloud/Fixtures/getClusters.json +++ b/plugins/UM3NetworkPrinting/tests/Cloud/Fixtures/getClusters.json @@ -4,7 +4,6 @@ "host_guid": "e90ae0ac-1257-4403-91ee-a44c9b7e8050", "host_name": "ultimakersystem-ccbdd30044ec", "host_version": "5.0.0.20170101", - "host_internal_ip": "", "is_online": true, "status": "active" }, { @@ -12,7 +11,6 @@ "host_guid": "e0ace90a-91ee-1257-4403-e8050a44c9b7", "host_name": "ultimakersystem-30044ecccbdd", "host_version": "5.1.2.20180807", - "host_internal_ip": "", "is_online": true, "status": "active" }] diff --git a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py index ff7c6b2b67..869b39440c 100644 --- a/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/tests/Cloud/TestCloudOutputDeviceManager.py @@ -7,6 +7,7 @@ from UM.OutputDevice.OutputDeviceManager import OutputDeviceManager from cura.UltimakerCloudAuthentication import CuraCloudAPIRoot from ...src.Cloud import CloudApiClient from ...src.Cloud import CloudOutputDeviceManager +from ...src.Cloud.Models.CloudClusterResponse import CloudClusterResponse from .Fixtures import parseFixture, readFixture from .NetworkManagerMock import NetworkManagerMock, FakeSignal @@ -55,7 +56,9 @@ class TestCloudOutputDeviceManager(TestCase): devices = self.device_manager.getOutputDevices() # TODO: Check active device - response_clusters = self.clusters_response.get("data", []) + response_clusters = [] + for cluster in self.clusters_response.get("data", []): + response_clusters.append(CloudClusterResponse(**cluster).toDict()) manager_clusters = sorted([device.clusterData.toDict() for device in self.manager._remote_clusters.values()], key=lambda cluster: cluster['cluster_id'], reverse=True) self.assertEqual(response_clusters, manager_clusters) From 19c6fceb0cfdecb38747c3f842e6c03d08681011 Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Mon, 1 Apr 2019 14:30:20 +0200 Subject: [PATCH 10/11] Delay using `getPluginPath()` until after start up time CL-1266 --- plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py b/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py index 2c7c33d382..7d3a76e749 100644 --- a/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py @@ -77,13 +77,15 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice): self.setIconName("print") - if PluginRegistry.getInstance() is not None: + self._output_controller = LegacyUM3PrinterOutputController(self) + + def _createMonitorViewFromQML(self) -> None: + if self._monitor_view_qml_path is None and PluginRegistry.getInstance() is not None: self._monitor_view_qml_path = os.path.join( PluginRegistry.getInstance().getPluginPath("UM3NetworkPrinting"), "resources", "qml", "MonitorStage.qml" ) - - self._output_controller = LegacyUM3PrinterOutputController(self) + super()._createMonitorViewFromQML() def _onAuthenticationStateChanged(self): # We only accept commands if we are authenticated. From 8700cbe4e85ee130430baeba62c254cf1d07353b Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Mon, 1 Apr 2019 15:22:38 +0200 Subject: [PATCH 11/11] Mypy fix CL-1266 --- plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index 07dc962bf8..0c044bbb56 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -152,7 +152,7 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice): # However, for manually added printers, the local IP address is used in lieu of a proper # network key, so check for that as well - if network_key.find(self.clusterData.host_internal_ip): + if self.clusterData.host_internal_ip is not None and network_key.find(self.clusterData.host_internal_ip): return True return False