Run custom tag on metrics-cd-test-1
This commit is contained in:
parent
9ff74eb056
commit
2762d5ba3b
|
@ -16,6 +16,23 @@ try:
|
|||
except (IOError, ModuleNotFoundError):
|
||||
OS_INFO = None
|
||||
|
||||
try:
|
||||
fqdn = socket.getfqdn()
|
||||
hostname = fqdn.split('.')[0]
|
||||
except OSError:
|
||||
host_info = None
|
||||
else:
|
||||
domainname = '.'.join(fqdn.split(".")[1:])
|
||||
environ = "beta" if (domainname.find("test") != -1) else "prod"
|
||||
print(domainname.find("thiss"))
|
||||
|
||||
host_info = {
|
||||
"domainname": domainname,
|
||||
"environment": environ,
|
||||
"fqdn": fqdn,
|
||||
"hostname": hostname,
|
||||
}
|
||||
|
||||
|
||||
def get_file_hash(modulesfile):
|
||||
"""
|
||||
|
@ -97,6 +114,10 @@ def main():
|
|||
if name_parts[1] == "test":
|
||||
modules["sunet"]["tag"] = "testing-2*"
|
||||
|
||||
if host_info:
|
||||
if host_info["fqdn"] == "metrics-cd-test-1.sunet.se":
|
||||
modules["apt"]["tag"] = "pahol-influx*"
|
||||
|
||||
# Build list of expected file content
|
||||
file_lines = create_file_content(modules)
|
||||
|
||||
|
|
Loading…
Reference in a new issue