Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
36 lines
1.3 KiB
Diff
36 lines
1.3 KiB
Diff
commit cca718816f66b0155602c974e6743e8ce49e367b
|
|
Author: Martin Weinelt <hexa@darmstadt.ccc.de>
|
|
Date: Thu Jun 12 03:37:27 2025 +0200
|
|
|
|
blueprints: copy default blueprints w/o permissions
|
|
|
|
There is no easy way to achieve this with shutil, because copytree() will
|
|
always call copystat() an ruin directory permissions.
|
|
|
|
diff --git a/homeassistant/components/blueprint/models.py b/homeassistant/components/blueprint/models.py
|
|
index 88052100259..a0b29ed3d01 100644
|
|
--- a/homeassistant/components/blueprint/models.py
|
|
+++ b/homeassistant/components/blueprint/models.py
|
|
@@ -378,9 +378,17 @@ class DomainBlueprints:
|
|
if self.blueprint_folder.exists():
|
|
return
|
|
|
|
- shutil.copytree(
|
|
- integration.file_path / BLUEPRINT_FOLDER,
|
|
- self.blueprint_folder / HOMEASSISTANT_DOMAIN,
|
|
- )
|
|
+ import os
|
|
+ os.makedirs(self.blueprint_folder / HOMEASSISTANT_DOMAIN)
|
|
+
|
|
+ import subprocess
|
|
+ subprocess.check_call([
|
|
+ "cp",
|
|
+ "--no-preserve=mode",
|
|
+ "--no-target-directory",
|
|
+ "--recursive",
|
|
+ str(integration.file_path / BLUEPRINT_FOLDER),
|
|
+ str(self.blueprint_folder / HOMEASSISTANT_DOMAIN),
|
|
+ ])
|
|
|
|
await self.hass.async_add_executor_job(populate)
|