diff --git a/cloudinit/url_helper.py b/cloudinit/url_helper.py index 1ebf713b552d..ecf8cd37802e 100644 --- a/cloudinit/url_helper.py +++ b/cloudinit/url_helper.py @@ -144,7 +144,7 @@ def read_ftps(url: str, timeout: float = 5.0, **kwargs: dict) -> "FtpResponse": LOG.debug("Reading file: %s", url_parts.path) ftp_tls.retrbinary(f"RETR {url_parts.path}", callback=buffer.write) - response = FtpResponse(buffer.getvalue()) + response = FtpResponse(buffer.getvalue(), url) LOG.debug("Closing connection") ftp_tls.close() return response @@ -177,7 +177,7 @@ def read_ftps(url: str, timeout: float = 5.0, **kwargs: dict) -> "FtpResponse": ) LOG.debug("Reading file: %s", url_parts.path) ftp.retrbinary(f"RETR {url_parts.path}", callback=buffer.write) - response = FtpResponse(contents=buffer.getvalue()) + response = FtpResponse(buffer.getvalue(), url) LOG.debug("Closing connection") ftp.close() return response diff --git a/tests/integration_tests/datasources/test_nocloud.py b/tests/integration_tests/datasources/test_nocloud.py index 06c616849316..bb496ebbf68b 100644 --- a/tests/integration_tests/datasources/test_nocloud.py +++ b/tests/integration_tests/datasources/test_nocloud.py @@ -387,7 +387,7 @@ def test_nocloud_ftp_unencrypted_server_succeeds( cmdline = "ds=nocloud;seedfrom=ftp://0.0.0.0:2121" self._boot_with_cmdline(cmdline, client) verify_clean_boot(client, ignore_warnings=self.expected_warnings) - assert "ftp-instance" == client.execute("hostname").rstrip() + assert "ftp-bootstrapper" == client.execute("hostname").rstrip() def test_nocloud_ftps_unencrypted_server_fails( self, client: IntegrationInstance @@ -420,7 +420,7 @@ def test_nocloud_ftps_encrypted_server_succeeds( cmdline = "ds=nocloud;seedfrom=ftps://localhost:2121" self._boot_with_cmdline(cmdline, client, encrypted=True) verify_clean_boot(client, ignore_warnings=self.expected_warnings) - assert "ftp-instance" == client.execute("hostname").rstrip() + assert "ftp-bootstrapper" == client.execute("hostname").rstrip() def test_nocloud_ftp_encrypted_server_fails( self, client: IntegrationInstance