Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
f rs
Browse files Browse the repository at this point in the history
  • Loading branch information
jrconlin committed Apr 27, 2018
1 parent 81188d6 commit 29e840b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions autopush/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ def from_argparse(cls, ns, **kwargs):
if not ns.no_aws:
ami_id = get_amid() or "Unknown"

import pdb;pdb.set_trace()
allow_table_rotation = not ns.no_table_rotation

return cls(
crypto_key=ns.crypto_key,
datadog_api_key=ns.datadog_api_key,
Expand Down Expand Up @@ -332,6 +335,7 @@ def from_argparse(cls, ns, **kwargs):
dh_param=ns.ssl_dh_param
),
sts_max_age=ns.sts_max_age,
allow_table_rotation=allow_table_rotation,
**kwargs
)

Expand Down
6 changes: 3 additions & 3 deletions autopush/main_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ def add_shared_args(parser):
help="AWS DynamoDB endpoint override",
type=str, default=None,
env_var="AWS_LOCAL_DYNAMODB")
parser.add_argument('--allow_table_rotation',
help="Allow monthly message table rotation",
parser.add_argument('--no_table_rotation',
help="Disallow monthly message table rotation",
action="store_true", default=False,
env_var="ALLOW_TABLE_ROTATION")
env_var="NO_TABLE_ROTATION")
# No ENV because this is for humans
_add_external_router_args(parser)
_obsolete_args(parser)
Expand Down
1 change: 0 additions & 1 deletion autopush/tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ def test_init_with_no_rotate_create_table(self):
latest = autopush.tests.boto_resource.get_latest_message_tablename(
prefix=fake_conf.message_table.tablename
)
print("### {} == {}".format(dm.current_msg_month, latest))
assert dm.current_msg_month == latest
assert dm.message_tables == [fake_conf.message_table.tablename]
finally:
Expand Down
1 change: 1 addition & 0 deletions autopush/tests/test_z_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ class TestArg(AutopushConfig):
sts_max_age = 1234
_no_sslcontext_cache = False
aws_ddb_endpoint = None
no_table_rotation = False

def setUp(self):
patchers = [
Expand Down
2 changes: 1 addition & 1 deletion configs/autopush_shared.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,4 @@ endpoint_port = 8082

; With TTL implemented, message table rotation is no longer required.
; This flag determines if table rotation should be allowed to continue:
#allow_table_rotation = true
#no_table_rotation

0 comments on commit 29e840b

Please sign in to comment.