Skip to content

Commit

Permalink
Update _validators.py
Browse files Browse the repository at this point in the history
  • Loading branch information
qwuae1 committed Jul 10, 2024
1 parent b1ac32e commit ce4a915
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/vm-repair/azext_vm_repair/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
from knack.util import CLIError
from azure.cli.core.azclierror import ValidationError

from opencensus.ext.azure.log_exporter import AzureLogHandler
from azure.cli.command_modules.vm.custom import get_vm, _is_linux_os
from azure.cli.command_modules.resource._client_factory import _resource_client_factory
from msrestazure.azure_exceptions import CloudError
from msrestazure.tools import parse_resource_id, is_valid_resource_id

from .telemetry import PROD_KEY
from .encryption_types import Encryption
from .exceptions import AzCommandError
from .repair_utils import (
Expand All @@ -23,13 +25,17 @@
_fetch_encryption_settings,
_resolve_api_version,
check_extension_version,
_check_existing_rg
_check_existing_rg,
_get_current_vmrepair_version
)

# pylint: disable=line-too-long, broad-except

logger = get_logger(__name__)
EXTENSION_NAME = 'vm-repair'
logger.addHandler(AzureLogHandler(
connection_string='InstrumentationKey='+PROD_KEY)
)


def validate_create(cmd, namespace):
Expand Down Expand Up @@ -429,4 +435,4 @@ def validate_repair_and_restore(cmd, namespace):

# Validate repair run command
source_vm = _validate_and_get_vm(cmd, namespace.resource_group_name, namespace.vm_name)
is_linux = _is_linux_os(source_vm)
is_linux = _is_linux_os(source_vm)

0 comments on commit ce4a915

Please sign in to comment.