make the nameservers used in hpchealthcheck configurable
diff --git a/xos/core/xoslib/methods/hpcview.py b/xos/core/xoslib/methods/hpcview.py
index 005d7e1..77ca7ed 100644
--- a/xos/core/xoslib/methods/hpcview.py
+++ b/xos/core/xoslib/methods/hpcview.py
@@ -15,13 +15,6 @@
import socket
import time
-NAMESERVERS = ["cdnrr1.opencloud.us",
- "cdnrr2.opencloud.us",
- "cdnrr3.opencloud.us",
- "cdnrr4.opencloud.us",
- "cdnrr5.opencloud.us",
- "cdnrr6.opencloud.us"]
-
# This REST API endpoint contains a bunch of misc information that the
# tenant view needs to display
@@ -134,7 +127,8 @@
# dnsdemux_has_public_network = True
nameservers = {}
- for nameserver in NAMESERVERS:
+ for nshc in hpc.hpchealthcheck_set.filter(kind="nameserver"):
+ nameserver = nshc.resource_name
try:
nameservers[nameserver] = {"name": nameserver, "ip": socket.gethostbyname(nameserver), "hit": False}
except:
diff --git a/xos/hpc/models.py b/xos/hpc/models.py
index 80f4260..48ae0f0 100644
--- a/xos/hpc/models.py
+++ b/xos/hpc/models.py
@@ -209,7 +209,7 @@
class Meta:
app_label = "hpc"
- KIND_CHOICES = (('dns', 'DNS'), ('http', 'HTTP'))
+ KIND_CHOICES = (('dns', 'DNS'), ('http', 'HTTP'), ('nameserver', 'Name Server'))
hpcService = models.ForeignKey(HpcService, blank = True, null=True)
kind = models.CharField(max_length=30, choices=KIND_CHOICES, default="dns")