mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-01 05:53:26 -07:00
django module, module_utils: adjustments (#10684)
* django module, module_utils: adjustments * fix name * more fixes * more fixes * further simplification * add changelog frag
This commit is contained in:
parent
5ee02297b0
commit
ded43714d3
4 changed files with 32 additions and 20 deletions
|
@ -88,7 +88,6 @@ version:
|
|||
"""
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.django import DjangoModuleHelper
|
||||
from ansible_collections.community.general.plugins.module_utils.cmd_runner import cmd_runner_fmt
|
||||
|
||||
|
||||
class DjangoCheck(DjangoModuleHelper):
|
||||
|
@ -102,15 +101,11 @@ class DjangoCheck(DjangoModuleHelper):
|
|||
),
|
||||
supports_check_mode=True,
|
||||
)
|
||||
arg_formats = dict(
|
||||
databases=cmd_runner_fmt.stack(cmd_runner_fmt.as_opt_val)("--database"),
|
||||
deploy=cmd_runner_fmt.as_bool("--deploy"),
|
||||
fail_level=cmd_runner_fmt.as_opt_val("--fail-level"),
|
||||
tags=cmd_runner_fmt.stack(cmd_runner_fmt.as_opt_val)("--tag"),
|
||||
apps=cmd_runner_fmt.as_list(),
|
||||
)
|
||||
django_admin_cmd = "check"
|
||||
django_admin_arg_order = "databases deploy fail_level tags apps"
|
||||
django_admin_arg_order = "database_stacked_dash deploy fail_level tags apps"
|
||||
|
||||
def __init_module__(self):
|
||||
self.vars.set("database_stacked_dash", self.vars.databases, output=False)
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
@ -60,10 +60,13 @@ class DjangoCreateCacheTable(DjangoModuleHelper):
|
|||
supports_check_mode=True,
|
||||
)
|
||||
django_admin_cmd = "createcachetable"
|
||||
django_admin_arg_order = "noinput database dry_run"
|
||||
_django_args = ["noinput", "database", "dry_run"]
|
||||
django_admin_arg_order = "noinput database_dash dry_run"
|
||||
_django_args = ["database_dash"]
|
||||
_check_mode_arg = "dry_run"
|
||||
|
||||
def __init_module__(self):
|
||||
self.vars.set("database_dash", self.vars.database, output=False)
|
||||
|
||||
|
||||
def main():
|
||||
DjangoCreateCacheTable.execute()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue