Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/aaz_dev/cli/api/_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def regenerate_code(extension_or_module_name, cli_path=None, cli_extension_path=
sys.exit(1)

try:
if cli_path is not None:
if cli_path is not None or Config.CLI_PATH is not None:
assert Config.CLI_PATH is not None
manager = AzMainManager()
else:
Expand Down Expand Up @@ -172,7 +172,7 @@ def generate_by_swagger_tag(profile, swagger_tag, extension_or_module_name, cli_

profile = _build_profile(profile, commands_map)

if cli_path is not None:
if cli_path is not None or Config.CLI_PATH is not None:
assert Config.CLI_PATH is not None
manager = AzMainManager()
else:
Expand Down Expand Up @@ -321,7 +321,7 @@ def to_cli():

commands_map[key] = command.version

if cli_path is not None:
if cli_path is not None or Config.CLI_PATH is not None:
assert Config.CLI_PATH is not None
manager = AzMainManager()

Expand Down
8 changes: 5 additions & 3 deletions src/aaz_dev/cli/controller/az_module_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ def get_aaz_path(self, mod_name):
raise NotImplementedError()

def has_module(self, mod_name):
mod_file = os.path.join(self.get_mod_path(mod_name), "setup.py")
if not os.path.exists(mod_file):
mod_path = self.get_mod_path(mod_name)
if not os.path.isdir(mod_path):
return False
return True
if os.path.exists(os.path.join(mod_path, "setup.py")):
return True
return os.path.exists(os.path.join(mod_path, "__init__.py"))

def find_module_cmd_registered(self, node):
group_nodes = deque()
Expand Down
6 changes: 1 addition & 5 deletions src/aaz_dev/cli/controller/az_operation_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,7 @@ def __init__(self, name, cmd_ctx, operation, client_endpoints):
else:
if not isinstance(response.body, CMDHttpResponseJsonBody):
if not response.body:
raise exceptions.InvalidAPIUsage(
f"Invalid `Error` response schema in operation `{self._operation.operation_id}`: "
f"Missing `schema` property in response "
f"`{response.status_codes or 'default'}`."
)
continue
else:
raise exceptions.InvalidAPIUsage(
f"Invalid `Error` response schema in operation `{self._operation.operation_id}`: "
Expand Down
2 changes: 2 additions & 0 deletions src/aaz_dev/command/model/configuration/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class CMDHttpRequestHeader(CMDHttpRequestArgs):

def generate_args(self, ref_args, var_prefix=None):
args = []
if not self.params:
return args
if var_prefix:
if not var_prefix.endswith("$"):
var_prefix += '.'
Expand Down
6 changes: 1 addition & 5 deletions src/aaz_dev/swagger/controller/command_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,7 @@ def format_http_operation(op, instance_var):
if resp.is_error:
if not isinstance(resp.body, CMDHttpResponseJsonBody):
if not resp.body:
raise exceptions.InvalidAPIUsage(
f"Invalid `Error` response schema in operation `{op.operation_id}`: "
f"Missing `schema` property in response "
f"`{resp.status_codes or 'default'}`."
)
continue
else:
raise exceptions.InvalidAPIUsage(
f"Invalid `Error` response schema in operation `{op.operation_id}`: "
Expand Down
Loading