You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: leverage/modules/project.py
+30-8Lines changed: 30 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -116,11 +116,22 @@ def init():
116
116
117
117
118
118
def_copy_account(account, primary_region):
119
-
"""Copy account directory and all its files.
120
-
119
+
"""
120
+
Copy an account's directory structure from the template repository to the project directory.
121
+
122
+
This function creates the account directory under the project root and replicates the necessary subdirectories by:
123
+
- Copying the configuration directory.
124
+
- Duplicating all global layers as defined in the project structure.
125
+
- Copying primary region-specific layers into the designated region folder.
126
+
127
+
All copy operations utilize a predefined ignore pattern (IGNORE_PATTERNS). Notably, the copy procedures for global and primary region layers are performed with symbolic link preservation (symlinks=True) to ensure that any symbolic links in the template are maintained in the destination.
128
+
121
129
Args:
122
-
account (str): Account name.
123
-
primary_region (str): Projects primary region.
130
+
account (str): The account name corresponding to a directory in the template.
131
+
primary_region (str): The project’s primary region, used to determine the target subdirectory for region-specific layers.
132
+
133
+
Raises:
134
+
OSError: If directory creation or file copy operations fail.
0 commit comments