Skip to content

Commit eaa5440

Browse files
committed
Merge branch 'develop' of github.com:MetaCell/cloud-harness into feature/CH-110
2 parents 0500ecf + 5bd4b73 commit eaa5440

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

tools/deployment-cli-tools/ch_cli_tools/openapi.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ def generate_openapi_from_ninja_schema(app_name: str, app_path: pathlib.Path) ->
156156
# check if cloudharness_django python library is installed
157157
python_module = to_python_module(app_name)
158158
try:
159-
import cloudharness_django
160-
# dynamicall import python_module
161-
__import__(f'{python_module}')
159+
import cloudharness_django # noqa
160+
# dynamically import python_module
161+
__import__(python_module)
162162
except ImportError:
163-
if confirm('Runtime env is not installed. Do you want to install it? [Y/n]'):
163+
if confirm('Runtime env is not installed. Do you want to install it?'):
164164
subprocess.check_call(["sh", "dev-setup.sh"], cwd=app_path)
165165
else:
166166
logging.error('Runtime env is not installed. Cound not generate openapi files for Django Ninja.')

tools/deployment-cli-tools/ch_cli_tools/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ def replaceindir(root_src_dir, source, replace):
180180
replace_in_file(src_file, source, replace)
181181

182182

183-
def confirm(question, default_true=True):
183+
def confirm(question):
184184
answer = input(f"{question} (Y/n): ").casefold()
185-
return (default_true and not answer) or answer == "y"
185+
return answer == "y" if answer else True
186186

187187

188188
def replace_in_file(src_file: pathlib.Path, source: str, replacement) -> None:

tools/deployment-cli-tools/harness-generate

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ def main():
1717
args = get_command_line_arguments()
1818
get_dependencies()
1919

20-
if args.path:
21-
root_path = args.path.absolute()
20+
root_path = args.path.absolute()
2221

23-
else:
24-
root_path = pathlib.Path.cwd()
25-
26-
# Check if applications folder exists, if not, go up until it's found
22+
# Check if applications folder exists, if not, go up until it's found
2723
while not (root_path / 'applications').exists():
2824
if root_path == root_path.parent:
2925
logging.error('Could not find applications folder')

0 commit comments

Comments
 (0)