in lisa/sut_orchestrator/azure/platform_.py [0:0]
def _get_environment_information(self, environment: Environment) -> Dict[str, str]:
information: Dict[str, str] = {}
node_runbook: Optional[AzureNodeSchema] = None
if environment.nodes:
node: Optional[Node] = environment.default_node
else:
node = None
if node:
node_runbook = node.capability.get_extended_runbook(AzureNodeSchema, AZURE)
# some information get from two places, so create separated methods to
# query them.
try:
host_version = self._get_host_version(node)
if host_version:
information[KEY_HOST_VERSION] = host_version
except Exception as identifier:
node.log.exception("error on get host version", exc_info=identifier)
try:
kernel_version = self._get_kernel_version(node)
if kernel_version:
information[KEY_KERNEL_VERSION] = kernel_version
except Exception as identifier:
node.log.exception("error on get kernel version", exc_info=identifier)
try:
wala_version = self._get_wala_version(node)
if wala_version:
information[KEY_WALA_VERSION] = wala_version
except Exception as identifier:
node.log.exception("error on get waagent version", exc_info=identifier)
information.update(self._get_platform_information(environment))
if node.is_connected and node.is_posix:
information.update(self._get_node_information(node))
elif environment.capability and environment.capability.nodes:
# get deployment information, if failed on preparing phase
node_space = environment.capability.nodes[0]
node_runbook = node_space.get_extended_runbook(
AzureNodeSchema, type_name=AZURE
)
if node_runbook:
information["location"] = node_runbook.location
information["vmsize"] = node_runbook.vm_size
information["image"] = node_runbook.get_image_name()
return information