Skip to content
This repository has been archived by the owner on Sep 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1072 from mikegrima/swagfix
Browse files Browse the repository at this point in the history
Updated SWAG sync to reference the top-level account status field
  • Loading branch information
mikegrima authored May 23, 2018
2 parents 4aa9c18 + 88a01fc commit 46f3082
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ policyuniverse>=1.1.0.1
joblib>=0.9.4
pyjwt>=1.01
netaddr
swag-client>=0.3.7
swag-client>=0.4.1
idna==2.6
marshmallow==2.15.0
flask-marshmallow==0.8.0
10 changes: 4 additions & 6 deletions security_monkey/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,12 @@ def sync_swag(owner, bucket_name, bucket_prefix, bucket_region, account_type, sp

# Check if the account is active or not:
# With the current SWAG schema, need to do the following:
# 1. Need to loop through all account["status"] and if a status is "active", then
# 1. Check if the 'account_status' field is set to 'ready'.
# 2. Loop through all the services for "security_monkey" and if the status is "active", then the account
# is active. This will change when we modify the schema to make a top-level account status field.
# is active.
check_active = active = False
for s in account["status"]:
if s["status"] == "ready":
check_active = True
break
if account['account_status'] == 'ready':
check_active = True

if check_active:
secmonkey_service = services_by_name.get('security_monkey', {})
Expand Down

0 comments on commit 46f3082

Please sign in to comment.