-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored plugins for run_for_prompt
- Loading branch information
Showing
15 changed files
with
91 additions
and
53 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from up_cli import pm | ||
from up_ansible import image_for_prompt | ||
from up_ansible import run_for_prompt | ||
|
||
pm.register(image_for_prompt) | ||
pm.register(run_for_prompt) |
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
from up_cli import hookimpl, match_prompt, RunConfig | ||
|
||
def mk_run_config(prompt): | ||
result = RunConfig( | ||
image="cytopia/ansible:latest", | ||
command=prompt) | ||
return result | ||
|
||
@hookimpl | ||
def run_for_prompt(prompt): | ||
return match_prompt(mk_run_config, prompt, "ansible") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
from up_cli import pm | ||
from up_splat import image_for_prompt | ||
from up_splat import substitutions_for_prompt | ||
from up_splat import run_for_prompt | ||
|
||
|
||
pm.register(image_for_prompt) | ||
pm.register(substitutions_for_prompt) | ||
pm.register(run_for_prompt) |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
from up_cli import hookimpl, match_prompt, RunConfig | ||
|
||
def mk_run_config(prompt): | ||
result = RunConfig( | ||
image="fedora", | ||
command=['echo', 'Thank you for trying UP: '] + prompt) | ||
return result | ||
|
||
@hookimpl | ||
def run_for_prompt(prompt): | ||
return match_prompt(mk_run_config, prompt, "splat") | ||
|
This file was deleted.
Oops, something went wrong.