This operation will do a login to each UCS which is present in credential file.

    - filePath specifies the path of the credential file.
    - key specifies string used for secure encryption while ExportUcsSession operation.

def ImportUcsSession(filePath, key):
	"""
    This operation will do a login to each UCS which is present in credential file.

    - filePath specifies the path of the credential file.
    - key specifies string used for secure encryption while ExportUcsSession operation.
    """
	from UcsBase import UcsUtils, WriteUcsWarning, UcsValidationException
	# from p3 import p3_encrypt, p3_decrypt

	if filePath is None:
		raise UcsValidationException("filePath parameter is not provided.")
	# raise Exception('[Error]: Please provide filePath')

	if key is None:
		raise UcsValidationException("key parameter is not provided.")
	# raise Exception('[Error]: Please provide key')

	if not os.path.isfile(filePath) or not os.path.exists(filePath):
		raise UcsValidationException('[Error]: File <%s> does not exist ' % (filePath))
	# raise Exception('[Error]: File <%s> does not exist ' %(filePath))

	doc = xml.dom.minidom.parse(filePath)
	topNode = doc.documentElement
	# print topNode.localName

	if topNode is None or topNode.localName != UcsLoginXml.UCS_HANDLES:
		return None

	if (topNode.hasChildNodes()):
		# childList = topNode._get_childNodes()
		# childCount = childList._get_length()
		childList = topNode.childNodes
		childCount = len(childList)
		for i in range(childCount):
			childNode = childList.item(i)
			if (childNode.nodeType != Node.ELEMENT_NODE):
				continue

			if childNode.localName != UcsLoginXml.UCS:
				continue

			lName = None
			lUsername = None
			lPassword = None
			lNoSsl = False
			lPort = None

			if childNode.hasAttribute(UcsLoginXml.NAME):
				lName = childNode.getAttribute(UcsLoginXml.NAME)

			if childNode.hasAttribute(UcsLoginXml.USER_NAME):
				lUsername = childNode.getAttribute(UcsLoginXml.USER_NAME)

			if childNode.hasAttribute(UcsLoginXml.PASSWORD):
				# lPassword = p3_decrypt(childNode.getAttribute(UcsLoginXml.PASSWORD), key)
				lPassword = UcsUtils.DecryptPassword(childNode.getAttribute(UcsLoginXml.PASSWORD), key)

			if childNode.hasAttribute(UcsLoginXml.NO_SSL):
				lNoSsl = childNode.getAttribute(UcsLoginXml.NO_SSL)

			if childNode.hasAttribute(UcsLoginXml.PORT):
				lPort = childNode.getAttribute(UcsLoginXml.PORT)

			# Process Login
			if ((lName is None) or (lUsername == None) or (lPassword == None)):
				# WriteUcsWarning("[Warning] Insufficient information for login ...")
				continue
			try:

				handle = UcsHandle()
				handle.Login(name=lName, username=lUsername, password=lPassword, noSsl=lNoSsl, port=lPort)


			except Exception, err:
				# TODO: Add Warning/Error messages in Logger.
				WriteUcsWarning("[Connection Error<%s>] %s" % (lName, str(err)))