File tree Expand file tree Collapse file tree 3 files changed +22
-25
lines changed Expand file tree Collapse file tree 3 files changed +22
-25
lines changed Original file line number Diff line number Diff line change 22import json
33from time_tracker_api .security import current_user_email
44from azure .appconfiguration import AzureAppConfigurationClient
5-
5+ from utils . check_variables import check_variables_are_defined
66
77class FeatureToggleConfig :
8- def check_variables_are_defined ():
9- azure_app_variable = 'AZURE_APP_CONFIGURATION_CONNECTION_STRING'
10- if azure_app_variable not in os .environ :
11- raise EnvironmentError (
12- "{} is not defined in the environment" .format (
13- azure_app_variable
14- )
15- )
16-
17- check_variables_are_defined ()
8+ check_variables_are_defined (['AZURE_APP_CONFIGURATION_CONNECTION_STRING' ])
189 AZURE_APP_CONFIGURATION_CONNECTION_STRING = os .environ .get (
1910 'AZURE_APP_CONFIGURATION_CONNECTION_STRING'
2011 )
Original file line number Diff line number Diff line change 33import requests
44import json
55from typing import List
6+ from utils .check_variables import check_variables_are_defined
67
78
89class MSConfig :
9- def check_variables_are_defined ():
10- auth_variables = [
11- 'MS_CLIENT_ID' ,
12- 'MS_AUTHORITY' ,
13- 'MS_SECRET' ,
14- 'MS_SCOPE' ,
15- 'MS_ENDPOINT' ,
16- ]
17- for var in auth_variables :
18- if var not in os .environ :
19- raise EnvironmentError (
20- "{} is not defined in the environment" .format (var )
21- )
10+ auth_variables = [
11+ 'MS_CLIENT_ID' ,
12+ 'MS_AUTHORITY' ,
13+ 'MS_SECRET' ,
14+ 'MS_SCOPE' ,
15+ 'MS_ENDPOINT' ,
16+ ]
17+
18+ check_variables_are_defined (auth_variables )
2219
23- check_variables_are_defined ()
2420 CLIENT_ID = os .environ .get ('MS_CLIENT_ID' )
2521 AUTHORITY = os .environ .get ('MS_AUTHORITY' )
2622 SECRET = os .environ .get ('MS_SECRET' )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ def check_variables_are_defined (variables ):
4+ for var in variables :
5+ if var not in os .environ :
6+ raise EnvironmentError (
7+ "{} is not defined in the environment" .format (var )
8+ )
9+
10+
You can’t perform that action at this time.
0 commit comments