Add getDomainName to vm functions

This commit is contained in:
Joshua Boniface 2018-09-25 02:26:37 -04:00
parent 7daed1b0d8
commit 9107e16c33
1 changed files with 11 additions and 1 deletions

View File

@ -25,7 +25,6 @@ import socket
import time import time
import uuid import uuid
import re import re
import tempfile
import subprocess import subprocess
import difflib import difflib
import colorama import colorama
@ -180,6 +179,17 @@ def getDomainUUID(zk_conn, domain):
return dom_uuid return dom_uuid
def getDomainName(zk_conn, domain):
# Validate and obtain alternate passed value
if common.validateUUID(domain):
dom_name = searchClusterByUUID(zk_conn, domain)
dom_uuid = searchClusterByName(zk_conn, dom_name)
else:
dom_uuid = searchClusterByName(zk_conn, domain)
dom_name = searchClusterByUUID(zk_conn, dom_uuid)
return dom_name
# #
# Direct functions # Direct functions
# #