Skip to content

Commit

Permalink
SUCCESS, FAILURE, CRASH have implicit data object of None
Browse files Browse the repository at this point in the history
  • Loading branch information
ndenny committed Jun 4, 2024
1 parent 4e6c5ca commit 8da7561
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bin/bastion.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
b. anchor (full) if drift >= policy
"""

def SUCCESS(doc, obj):
def SUCCESS(doc, obj = None):
return {
'reply': {
'status': '200',
Expand All @@ -50,7 +50,7 @@ def SUCCESS(doc, obj):
}


def FAILED(doc, obj):
def FAILED(doc, obj = None):
return {
'reply': {
'status': '400',
Expand All @@ -61,7 +61,7 @@ def FAILED(doc, obj):
}


def CRASHED(doc, obj):
def CRASHED(doc, obj = None):
return {
'reply': {
'status': '500',
Expand Down Expand Up @@ -149,7 +149,7 @@ def run(self):
try:
answer = action(comargs, comdex)
except Exception as err:
answer = CRASHED(str(err))
answer = CRASHED(str(err), str(err))

sys.stdout.write( yaml.dump(answer, default_flow_style = False) )
if answer['reply']['status'][0] in ('1','2','3'):
Expand All @@ -171,7 +171,6 @@ def do_backup_asset(self, comargs, comdex):
backup asset {ARK}
"""
ark = ARK(comdex[2])
# print(ark)
site = self.site(ark.site)
asset = site.asset(ark)
vault = self.vault(asset.policy.vault)
Expand Down

0 comments on commit 8da7561

Please sign in to comment.