launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #30513
[Merge] ~lgp171188/launchpad-layers:add-scripts-dir into launchpad-layers:main
Guruprasad has proposed merging ~lgp171188/launchpad-layers:add-scripts-dir into launchpad-layers:main.
Commit message:
Add a 'scripts_dir' well-known directory
This can be used for placing scripts that are not in
the Launchpad source tree.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~lgp171188/launchpad-layers/+git/launchpad-layers/+merge/452259
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/launchpad-layers:add-scripts-dir into launchpad-layers:main.
diff --git a/launchpad-base/lib/charms/launchpad/base.py b/launchpad-base/lib/charms/launchpad/base.py
index 043cd4f..e75c22b 100644
--- a/launchpad-base/lib/charms/launchpad/base.py
+++ b/launchpad-base/lib/charms/launchpad/base.py
@@ -25,6 +25,10 @@ def var_dir():
return os.path.join(base.base_dir(), "var")
+def scripts_dir():
+ return os.path.join(base.base_dir(), "scripts")
+
+
def change_shell(user, shell):
if (
subprocess.run(
@@ -62,6 +66,7 @@ def get_service_config():
"oopses_dir": oopses_dir(),
# Used by some templates.
"parseaddr": parseaddr,
+ "scripts_dir": scripts_dir(),
"secrets_dir": secrets_dir(),
"var_dir": var_dir(),
}