Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.8 logs #7787

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/vm-repair/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

Release History
===============
1.0.7
++++++
add logs tracking and command adjustment

1.0.6
++++++
Add CLI update wait for ASG to wait for the operation done as the async 2rd operation will cancel the 1st call.
Expand Down
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)
2 changes: 1 addition & 1 deletion src/vm-repair/azext_vm_repair/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def reset_nic(cmd, vm_name, resource_group_name, yes=False):
_call_az_command(update_ip_command)

# Wait for IP updated
wait_ip_update_command = 'az network nic ip-config wait --updated -g {g} --nic-name {nic} -n ' \
wait_ip_update_command = 'az network nic ip-config wait --updated -g {g} --nic-name {nic}' \
.format(g=resource_group_name, nic=primary_nic_name)
_call_az_command(wait_ip_update_command)

Expand Down
4 changes: 2 additions & 2 deletions src/vm-repair/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from codecs import open
from setuptools import setup, find_packages

VERSION = "1.0.6"
VERSION = "1.0.7"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand All @@ -24,7 +24,7 @@
'License :: OSI Approved :: MIT License',
]

DEPENDENCIES = []
DEPENDENCIES = ['opencensus~=0.11.4']

with open('HISTORY.rst', 'r', encoding='utf-8') as f:
HISTORY = f.read()
Expand Down
Loading