Skip to content

Commit

Permalink
Introduce OVERRIDE_HOSTNAME in RQD for manually settings a hostname. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
splhack authored Dec 18, 2020
1 parent 97cc88c commit 078978a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions rqd/rqd/rqconstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
OVERRIDE_PROCS = None # number of physical cpus. ex: None or 2
OVERRIDE_MEMORY = None # in Kb
OVERRIDE_NIMBY = None # True to turn on, False to turn off
OVERRIDE_HOSTNAME = None # Force to use this hostname
ALLOW_GPU = False
ALLOW_PLAYBLAST = False
LOAD_MODIFIER = 0 # amount to add/subtract from load
Expand Down Expand Up @@ -175,6 +176,8 @@
CUEBOT_HOSTNAME = config.get(__section, "OVERRIDE_CUEBOT")
if config.has_option(__section, "OVERRIDE_NIMBY"):
OVERRIDE_NIMBY = config.getboolean(__section, "OVERRIDE_NIMBY")
if config.has_option(__section, "OVERRIDE_HOSTNAME"):
OVERRIDE_HOSTNAME = config.get(__section, "OVERRIDE_HOSTNAME")
if config.has_option(__section, "GPU"):
ALLOW_GPU = config.getboolean(__section, "GPU")
if config.has_option(__section, "PLAYBLAST"):
Expand Down
4 changes: 3 additions & 1 deletion rqd/rqd/rqutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ def getHostIp():
def getHostname():
"""Returns the machine's fully qualified domain name"""
try:
if rqd.rqconstants.RQD_USE_IP_AS_HOSTNAME:
if rqd.rqconstants.OVERRIDE_HOSTNAME:
return rqd.rqconstants.OVERRIDE_HOSTNAME
elif rqd.rqconstants.RQD_USE_IP_AS_HOSTNAME:
return getHostIp()
else:
return socket.gethostbyaddr(socket.gethostname())[0].split('.')[0]
Expand Down

0 comments on commit 078978a

Please sign in to comment.
  翻译: