PERF403: fix
This commit is contained in:
@@ -58,10 +58,7 @@ def ssh_command(args: argparse.Namespace) -> None:
|
|||||||
raise ClanError(msg)
|
raise ClanError(msg)
|
||||||
|
|
||||||
# Convert ssh_option list to dictionary
|
# Convert ssh_option list to dictionary
|
||||||
ssh_options = {}
|
ssh_options = dict(args.ssh_option) if args.ssh_option else {}
|
||||||
if args.ssh_option:
|
|
||||||
for name, value in args.ssh_option:
|
|
||||||
ssh_options[name] = value
|
|
||||||
|
|
||||||
remote = remote.override(
|
remote = remote.override(
|
||||||
host_key_check=args.host_key_check,
|
host_key_check=args.host_key_check,
|
||||||
|
|||||||
@@ -105,11 +105,10 @@ def fix_nullables(schema: dict) -> dict:
|
|||||||
if isinstance(schema, dict):
|
if isinstance(schema, dict):
|
||||||
if "type" in schema and schema["type"] == "null":
|
if "type" in schema and schema["type"] == "null":
|
||||||
# Convert 'type: null' to 'nullable: true'
|
# Convert 'type: null' to 'nullable: true'
|
||||||
new_schema = {"nullable": True}
|
|
||||||
# Merge any other keys from original schema except type
|
# Merge any other keys from original schema except type
|
||||||
for k, v in schema.items():
|
new_schema = {"nullable": True} | {
|
||||||
if k != "type":
|
k: v for k, v in schema.items() if k != "type"
|
||||||
new_schema[k] = v
|
}
|
||||||
return fix_nullables(new_schema)
|
return fix_nullables(new_schema)
|
||||||
|
|
||||||
# If 'oneOf' present
|
# If 'oneOf' present
|
||||||
|
|||||||
Reference in New Issue
Block a user