Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Commit

Permalink
adjustment for recent gouttelette changes
Browse files Browse the repository at this point in the history
We need to pass `target_dir` in a couple of extra cases now.
  • Loading branch information
goneri committed Dec 21, 2022
1 parent f0c0499 commit 5aa9f90
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions vmware_rest_code_generator/cmd/refresh_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ def write_M(cls, my_string):
).rstrip()


def gen_documentation(name, description, parameters, added_ins, next_version):
def gen_documentation(
name, target_dir: pathlib.Path, description, parameters, added_ins, next_version
):

short_description = description.split(". ")[0]
documentation = {
Expand Down Expand Up @@ -302,7 +304,7 @@ def gen_documentation(name, description, parameters, added_ins, next_version):
documentation["options"][normalized_name] = option
parameter["added_in"] = next_version

module_from_config = get_module_from_config(name, "vmware_rest_code_generator")
module_from_config = get_module_from_config(name, target_dir)
if module_from_config and "documentation" in module_from_config:
for k, v in module_from_config["documentation"].items():
documentation[k] = v
Expand Down Expand Up @@ -767,6 +769,7 @@ def renderer(self, target_dir, next_version):
documentation = format_documentation(
gen_documentation(
self.name,
target_dir,
self.description(),
self.parameters(),
added_ins,
Expand All @@ -777,7 +780,7 @@ def renderer(self, target_dir, next_version):

content = jinja2_renderer(
self.template_file,
"vmware_rest_code_generator",
target_dir=target_dir,
arguments=indent(arguments, 4),
documentation=documentation,
list_index=self.list_index(),
Expand Down Expand Up @@ -1029,7 +1032,7 @@ def main():
resource, definitions=swagger_file.definitions
)
if (
module.is_trusted("vmware_rest_code_generator")
module.is_trusted(target_dir=args.target_dir)
and len(module.default_operationIds) > 0
):
module.renderer(
Expand All @@ -1041,7 +1044,7 @@ def main():
resource, definitions=swagger_file.definitions
)
if (
module.is_trusted("vmware_rest_code_generator")
module.is_trusted(target_dir=args.target_dir)
and len(module.default_operationIds) > 0
):
module.renderer(
Expand All @@ -1052,7 +1055,7 @@ def main():
module = AnsibleModule(resource, definitions=swagger_file.definitions)

if (
module.is_trusted("vmware_rest_code_generator")
module.is_trusted(target_dir=args.target_dir)
and len(module.default_operationIds) > 0
):
module.renderer(
Expand Down

0 comments on commit 5aa9f90

Please sign in to comment.