Skip to content
Merged
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
5 changes: 5 additions & 0 deletions src/vm-repair/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@

Release History
===============

0.5.8
++++++
Fix az vm repair run --preview parameter to take in fork and branch name of User's repository.

0.5.7
++++++
Remove VM-repair SUSE image check
Expand Down
4 changes: 2 additions & 2 deletions src/vm-repair/azext_vm_repair/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
az vm repair run -g MyResourceGroup -n MySourceWinVM --custom-script-file ./file.ps1 --verbose
- name: Run unverified script from your fork of https://github.com/Azure/repair-script-library
text: >
az vm repair run -g MyResourceGroup -n MySourceWinVM --preview "https://github.com/haagha/repair-script-library/blob/master/map.json" --run-id test
az vm repair run -g MyResourceGroup -n MySourceWinVM --preview "https://github.com/User/repair-script-library/blob/main/map.json" --run-id test
"""

helps['vm repair list-scripts'] = """
Expand All @@ -75,7 +75,7 @@
az vm repair list-scripts --query "[?contains(description, 'test')]"
- name: List unverified script from your fork of https://github.com/Azure/repair-script-library
text: >
az vm repair list-scripts --preview "https://github.com/haagha/repair-script-library/blob/master/map.json"
az vm repair list-scripts --preview "https://github.com/User/repair-script-library/blob/main/map.json"
"""

helps['vm repair reset-nic'] = """
Expand Down
8 changes: 8 additions & 0 deletions src/vm-repair/azext_vm_repair/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,14 @@ def run(cmd, vm_name, resource_group_name, run_id=None, repair_vm_id=None, custo
# Fetch run path from GitHub
repair_script_path = _fetch_run_script_path(run_id)
run_command_params.append('script_path="./{}"'.format(repair_script_path))
if preview:
parts = preview.split('/')
if len(parts) != 7:
raise Exception('Invalid preview url. Write full URL of map.json file. example https://github.com/Azure/repair-script-library/blob/main/map.json')
fork_name = parts[3]
branch_name = parts[6]
run_command_params.append('repo_fork="{}"'.format(fork_name))
run_command_params.append('repo_branch="{}"'.format(branch_name))

# Custom script scenario for script testers
else:
Expand Down
6 changes: 4 additions & 2 deletions src/vm-repair/azext_vm_repair/scripts/win-run-driver.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Param([Parameter(Mandatory=$true)][string]$script_path,[Parameter(Mandatory=$false)][bool]$init=$true,[Parameter(Mandatory=$false)][string]$params='')
Param([Parameter(Mandatory=$true)][string]$script_path,[Parameter(Mandatory=$false)][string]$repo_fork, [Parameter(Mandatory=$false)][string]$repo_branch, [Parameter(Mandatory=$false)][bool]$init=$true,[Parameter(Mandatory=$false)][string]$params='')
if ($init)
{
try {
Expand All @@ -11,7 +11,9 @@ if ($init)
$logFileName = "logs-$curDate.txt"
Set-Content -Path "./$logFileName" -Value "[Log-Start $(Get-Date)]"
$logFile = (Resolve-Path "./$logFileName").Path
(new-object net.webclient).DownloadFile('https://github.com/Azure/repair-script-library/zipball/master/', (Join-Path $pwd 'repair-script-library.zip'))

$url = "https://github.com/$repo_fork/repair-script-library/zipball/$repo_branch/"
(new-object net.webclient).DownloadFile($url, (Join-Path $pwd 'repair-script-library.zip'))
Expand-Archive -Path 'repair-script-library.zip' -DestinationPath 'repair-script-library'
$reponame = dir repair-script-library -n
Set-Location (Join-Path 'repair-script-library' $reponame)
Expand Down
2 changes: 1 addition & 1 deletion 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 = "0.5.7"
VERSION = "0.5.8"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down