Handle errors which checking for a missing app.
This commit is contained in:
parent
8576137557
commit
27f5c9fc21
@ -278,9 +278,15 @@ def command(ctx, kube_config, laconic_config, image_registry, deployment_parent_
|
||||
print(f"Skipping request {r.id}, we've already seen it.")
|
||||
continue
|
||||
|
||||
try:
|
||||
app = laconic.get_record(r.attributes.application)
|
||||
except Exception as e:
|
||||
print("ERROR: " + str(e))
|
||||
app = None
|
||||
|
||||
if not app:
|
||||
print("Skipping request %s, cannot locate app." % r.id)
|
||||
print(f"Skipping request {r.id}, cannot locate app.")
|
||||
dump_known_requests(state_file, [r])
|
||||
continue
|
||||
|
||||
requested_name = r.attributes.dns
|
||||
|
@ -172,7 +172,7 @@ class LaconicRegistryClient:
|
||||
name_or_id,
|
||||
]
|
||||
|
||||
parsed = [AttrDict(r) for r in json.loads(logged_cmd(self.log_file, *args))]
|
||||
parsed = [AttrDict(r) for r in json.loads(logged_cmd(self.log_file, *args)) if r]
|
||||
if len(parsed):
|
||||
self._add_to_cache(parsed)
|
||||
return parsed[0]
|
||||
|
Loading…
Reference in New Issue
Block a user