forked from awslabs/open-data-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathext.py
More file actions
24 lines (18 loc) · 609 Bytes
/
Copy pathext.py
File metadata and controls
24 lines (18 loc) · 609 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
import yaml
# Check if provided tags are in tags.yaml
def ext_tags(value, rule_obj, path):
tags = yaml.safe_load(open('tags.yaml'))
tags.append('aws-pds')
if value not in tags:
print('Invalid tag!', value)
return False
# If we're here, all tags were ok
return True
# Check if provided resources are in resources.yaml
def ext_resources(value, rule_obj, path):
resources = yaml.safe_load(open('resources.yaml'))
if value not in resources:
print('Invalid resource!', value)
return False
# If we're here, all resources were ok
return True