This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As an installer user, plugin snippets will by symlinked
fixes: #6213
- Loading branch information
1 parent
ff49789
commit 32d9383
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python | ||
|
||
# Checks if the pulp plugin has a specific webserver snippet. | ||
|
||
# Usage: check_snippet.py plugin_name snippet_file | ||
|
||
# Usage example: check_snippet.py pulp_ansible nginx.conf | ||
|
||
# Prints full path to the snippet to stdout and returns rc 0 if found. | ||
# Prints to stderr and returns rc 10 if there are snippets, but not the snippet. | ||
# Prints to stderr and rc 1 if plugin is not found. | ||
|
||
import os | ||
import importlib | ||
import sys | ||
webserver_snippets = importlib.import_module(sys.argv[1] + ".app.webserver_snippets") | ||
snippet = os.path.dirname(webserver_snippets.__file__) + "/" + sys.argv[2] | ||
if os.path.exists(snippet): | ||
print(snippet) | ||
else: | ||
sys.stderr.write(sys.argv[1] + " has snippets, but not " + sys.argv[2] + "\n") | ||
sys.exit(10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters