forked from fybrik/hello-world-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello-world-module.py
33 lines (26 loc) · 1.03 KB
/
hello-world-module.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
#!/usr/bin/env python
import os
import yaml
def main():
print("\nHello World Module!")
# Read config map values from volume mount
with open('/hello-world-module/conf.yaml', 'r') as stream:
content = yaml.safe_load(stream)
for key,val in content.items():
if "data" in key:
data = val[0]
connectionName = data["connection.name"]
connectionFormat = data["format"]
vault = data["vault_credentials"]
s3Bucket = data["s3.bucket"]
s3Endpoint = data["s3.endpoint"]
print("\nConnection name is " + connectionName)
print("\nConnection format is " + connectionFormat)
print("\nVault credential address is " + vault["address"])
print("\nVault credential role is " + vault["role"])
print("\nVault credential secret path is " + vault["secretPath"])
print("\nS3 bucket is " + s3Bucket)
print("\nS3 endpoint is " + s3Endpoint)
print ("\nCOPY SUCCEEDED")
if __name__ == "__main__":
main()