(DIO-3138) vmpooler v2 api missing vm/hostname

there was one API that was falling back on v1 and was returning a domain key.
in order to make it consistent with the changes in v2, the domain is not returned
anymore, and the fqdn is returned if it is available
This commit is contained in:
Samuel Beaulieu 2022-06-29 13:57:48 -05:00
parent c3a6fd2527
commit 6aa10151ca
No known key found for this signature in database
GPG key ID: 12030F74136D0F34
3 changed files with 79 additions and 8 deletions

View file

@ -181,14 +181,9 @@ module Vmpooler
/^\d{4}-\d{2}-\d{2}$/ === date_str
end
# note: domain is not needed here, so we should update the callers of this method
def hostname_shorten(hostname, domain=nil)
if domain && hostname =~ /^[\w-]+\.#{domain}$/
hostname = hostname[/[^.]+/]
elsif hostname =~ /^[\w-]+\..+$/
hostname = hostname[/[^.]+/]
end
hostname
hostname[/[^.]+/]
end
def get_task_times(backend, task, date_str)