forked from andela/mrm_api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_mrm_services.py
More file actions
28 lines (23 loc) · 792 Bytes
/
run_mrm_services.py
File metadata and controls
28 lines (23 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys
from services.room_cancelation.auto_cancel_event import UpdateRecurringEvent
from services.data_deletion.clean_deleted_data_from_db import DataDeletion
services = {
"clean_database": DataDeletion().clean_deleted_data,
"autocancel_events": UpdateRecurringEvent().update_recurring_event_status
}
def run_mrm_services(arguments):
all_services = list(services.keys())
try:
if not arguments:
arguments = list(services.keys())
for argument in arguments:
services[argument]()
except KeyError as wrong_key:
print(
wrong_key,
"is not a valid service. Use one of these",
all_services
)
if __name__ == "__main__":
arguments = sys.argv[1:]
run_mrm_services(arguments)