Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 6280cb1

Browse files
authored
Merge pull request #744 from jumpstarter-dev/backport-743-to-release-0.7
[Backport release-0.7] flasher driver: always set system date
2 parents a5107a3 + b9aa011 commit 6280cb1

File tree

1 file changed

+7
-6
lines changed
  • packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers

1 file changed

+7
-6
lines changed

packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,13 @@ def _perform_flash_operation(
329329
self.logger.error(f"Error running udhcpc: {e}")
330330
raise FlashRetryableError(f"Error running udhcpc: {e}") from e
331331

332+
# make sure that the remote system has the right time without using NTP
333+
# otherwise SSL certificate verification will fail
334+
self.logger.info("Setting the remote DUT time to match the local system time")
335+
current_timestamp = int(time.time())
336+
console.sendline(f"date -s @{current_timestamp}")
337+
console.expect(manifest.spec.login.prompt, timeout=EXPECT_TIMEOUT_DEFAULT)
338+
332339
stored_cacert = None
333340
if should_download_to_httpd:
334341
self._wait_for_storage_thread(storage_thread, error_queue)
@@ -383,12 +390,6 @@ def _setup_flasher_ssl(self, console, manifest, cacert_file: str | None) -> str
383390
Raises:
384391
RuntimeError: If there's an error reading the CA certificate file
385392
"""
386-
# make sure that the remote system has the right time without using NTP
387-
# otherwise SSL certificate verification will fail
388-
self.logger.info("Setting the remote DUT time to match the local system time")
389-
current_timestamp = int(time.time())
390-
console.sendline(f"date -s @{current_timestamp}")
391-
console.expect(manifest.spec.login.prompt, timeout=EXPECT_TIMEOUT_DEFAULT)
392393

393394
if cacert_file:
394395
cacert = b""

0 commit comments

Comments
 (0)