Right now, aerie-cli expansions deploy catches all exceptions when uploading rules and sets. Update this to abort the full bulk deployment for base exceptions (Ctrl + C).
|
for rule in configuration.rules: |
|
try: |
|
with open(rules_path.joinpath(rule.file_name), "r") as fid: |
|
expansion_logic = fid.read() |
|
|
|
rule_id = client.create_expansion_rule( |
|
expansion_logic=expansion_logic, |
|
activity_name=rule.activity_type, |
|
model_id=model_id, |
|
command_dictionary_id=command_dictionary_id, |
|
name=rule.name + name_suffix |
|
) |
|
typer.echo(f"Created expansion rule {rule.name + name_suffix}: {rule_id}") |
|
uploaded_rules[rule.name] = rule_id |
|
except: |
|
typer.echo(f"Failed to create expansion rule {rule.name}") |
|
|
|
for set in configuration.sets: |
|
try: |
|
rule_ids = [] |
|
for rule_name in set.rules: |
|
if rule_name in uploaded_rules.keys(): |
|
rule_ids.append(uploaded_rules[rule_name]) |
|
else: |
|
typer.echo(f"No uploaded rule {rule_name} for set {set.name}") |
|
|
|
assert len(rule_ids) |
|
|
|
set_id = client.create_expansion_set( |
|
command_dictionary_id=command_dictionary_id, |
|
model_id=model_id, |
|
expansion_ids=rule_ids, |
|
name=set.name + name_suffix |
|
) |
|
|
|
typer.echo(f"Created expansion set {set.name + name_suffix}: {set_id}") |
|
except: |
|
typer.echo(f"Failed to create expansion set {set.name}") |
Right now,
aerie-cli expansions deploycatches all exceptions when uploading rules and sets. Update this to abort the full bulk deployment for base exceptions (Ctrl + C).aerie-cli/src/aerie_cli/commands/expansion.py
Lines 86 to 123 in 353ffbf