-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpaths.py
61 lines (49 loc) · 1.99 KB
/
paths.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import os
_own_dir = os.path.abspath(os.path.dirname(__file__))
_json_schema_path = os.path.join(_own_dir, 'schema')
compliance_data_req_jsonschema_path = os.path.join(
_json_schema_path,
'compliance-data-request-schema.yaml',
)
compliance_data_resp_jsonschema_path = os.path.join(
_json_schema_path,
'compliance-data-response-schema.yaml',
)
component_responsibles_req_jsonschema_path = os.path.join(
_json_schema_path,
'component-responsibles-request.yaml',
)
component_responsibles_resp_jsonschema_path = os.path.join(
_json_schema_path,
'component-responsibles-response.yaml',
)
token_jsonschema_path = os.path.join(_json_schema_path, 'token-payload-schema.yaml')
_responsibles_path = os.path.join(_own_dir, 'responsibles')
responsibles_username_negative_list_path = os.path.join(
_responsibles_path,
'responsibles_username_negative_list.yaml',
)
test_resources_apiserver_proxy = os.path.join(_own_dir, 'test/resources/apiserver-proxy.json')
test_resources_mcm = os.path.join(_own_dir, 'test/resources/machine-controller-manager.json')
test_resources_gardener_org_members = os.path.join(
_own_dir,
'test/resources/gardener_org_members.yaml',
)
_compliance_summary_path = os.path.join(_own_dir, 'compliance_summary')
artefact_metadata_cfg = os.path.join(_compliance_summary_path, 'artefact_metadata_cfg.yaml')
_features_path = os.path.join(_own_dir, 'features')
features_cfg = os.path.join(_features_path, 'features_cfg.yaml')
version_file = os.path.join(_own_dir, 'VERSION')
_auth_dir_path = os.path.join(_own_dir, 'auth')
users_path = os.path.join(_auth_dir_path, 'users.yaml')
roles_path = os.path.join(_auth_dir_path, 'roles.yaml')
teams_path = os.path.join(_auth_dir_path, 'teams.yaml')
def features_cfg_path() -> str:
if (
(env_features_cfg_path := os.environ.get('FEATURES_CFG_PATH')) and
os.path.isfile(env_features_cfg_path)
):
return env_features_cfg_path
if os.path.isfile(features_cfg):
return features_cfg
return None