зеркало из https://github.com/microsoft/lisa.git
Delete AMA extension at start in case its already installed (#3285)
* Update AzureMonitorAgentLinux.py * Update AzureMonitorAgentLinux.py * Update AzureMonitorAgentLinux.py * Update AzureMonitorAgentLinux.py * Update AzureMonitorAgentLinux.py * fix indent * fix indent
This commit is contained in:
Родитель
7820764c99
Коммит
788bbe624d
|
@ -1,6 +1,7 @@
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from assertpy import assert_that
|
from assertpy import assert_that
|
||||||
|
from azure.core.exceptions import HttpResponseError
|
||||||
|
|
||||||
from lisa import (
|
from lisa import (
|
||||||
Logger,
|
Logger,
|
||||||
|
@ -52,6 +53,13 @@ class AzureMonitorAgentLinuxExtension(TestSuite):
|
||||||
# Run VM Extension
|
# Run VM Extension
|
||||||
extension = node.features[AzureExtension]
|
extension = node.features[AzureExtension]
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Delete VM Extension if already present
|
||||||
|
extension.delete("AzureMonitorLinuxAgent")
|
||||||
|
except HttpResponseError as identifier:
|
||||||
|
if any(s in str(identifier) for s in ["was not found"]):
|
||||||
|
log.info("AzureMonitorLinuxAgent is not already installed")
|
||||||
|
|
||||||
extension_result = extension.create_or_update(
|
extension_result = extension.create_or_update(
|
||||||
name="AzureMonitorLinuxAgent",
|
name="AzureMonitorLinuxAgent",
|
||||||
publisher="Microsoft.Azure.Monitor",
|
publisher="Microsoft.Azure.Monitor",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче