Skip to content

Commit

Permalink
Merge pull request #24 from CIDgravity/update-response-on-maintenance…
Browse files Browse the repository at this point in the history
…-mode

Update response on maintenance mode for default accept policy
  • Loading branch information
zteeed authored Aug 26, 2022
2 parents 2670c90 + 1a314fa commit d083eb6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cidgravity_storage_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import argparse
import datetime

VERSION = "1.5"
VERSION = "1.6"

################################################################################
# DEFAULT VALUES
Expand Down Expand Up @@ -220,7 +220,10 @@ def run():
if response.status_code != 200:
if CONFIG["logging"]["debug"]:
log(json.dumps(dict(response.headers), indent=4, sort_keys=True) + "\n" + str(response.content), "API_RESPONSE", "DEBUG")
decision(DEFAULT_BEHAVIOR, f"Error : API code : { response.status_code } - { response.reason }", "Error")
if DEFAULT_BEHAVIOR == "accept":
decision(DEFAULT_BEHAVIOR, f"Error : API code : {response.status_code} - {response.reason}", "")
else:
decision(DEFAULT_BEHAVIOR, f"Error : API code : {response.status_code} - {response.reason}", "Error")

# READ API RESPONSE
try:
Expand Down

0 comments on commit d083eb6

Please sign in to comment.