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

Commit b9aa011

Browse files
mangelajogithub-actions[bot]
authored andcommitted
flasher driver: always set system date
Otherwise, in labs where ntp is not available for the DUTs to use, time setting will be wrong and fls, or CA cert checking will fail. (cherry picked from commit aa8022a)
1 parent a5107a3 commit b9aa011

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

  • packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers

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)