selfprivacy-rest-api/selfprivacy_api/utils.py

10 lines
274 B
Python
Raw Normal View History

2021-11-11 18:31:28 +00:00
#!/usr/bin/env python3
2021-11-16 16:14:01 +00:00
"""Various utility functions"""
2021-11-11 18:31:28 +00:00
def get_domain():
2021-11-16 16:14:01 +00:00
"""Get domain from /var/domain without trailing new line"""
with open("/var/domain", "r", encoding="utf-8") as domain_file:
domain = domain_file.readline().rstrip()
2021-11-11 18:31:28 +00:00
return domain