Azure-cli: az lab vm apply-artifacts doesn't work with python 2.7

Created on 28 Apr 2017  路  5Comments  路  Source: Azure/azure-cli

Description

Outline the issue here:
command only works on python 3.5


Environment summary

Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here:

CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here: CLI 2.0

OS Version: What OS and version are you using?
Answer here:

Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here:

DevTestLabs Service Attention bug

All 5 comments

@vishrutshah : This will be for Build

@lisawong19

Reasons:

  • [ ] json.load for --artifacts parameter does not perform snake_case translation for keys of input dictionary
  • [ ] Validator was missing onto --artifacts that is causing artifactId from json input was not converted into fully qualified resource Id

Fix is included https://github.com/Azure/azure-cli/pull/2997/commits/50aa53135d86cc2a6582c6e911d332bff5aa9990#diff-c2f6f2cef5de551e95ad8ca6a94f1f13R71

Verification:

(env27) D:\Repos\azure-cli>python --version
Python 2.7.12

(env27) D:\Repos\azure-cli>az lab vm apply-artifacts -h

Command
    az lab vm apply-artifacts: Command to apply artifacts to virtual machine in Azure DevTest Lab.

Arguments
    --lab-name          [Required]: Name of the Lab.
    --name -n           [Required]: Name of the virtual machine.
    --resource-group -g [Required]: Name of lab's resource group.
    --artifacts                   : JSON encoded array of artifacts to be applied. Use @{file} to
                                    load from a file.

Global Arguments
    --debug                       : Increase logging verbosity to show all debug logs.
    --help -h                     : Show this help message and exit.
    --output -o                   : Output format.  Allowed values: json, jsonc, table, tsv.
                                    Default: json.
    --query                       : JMESPath query string. See http://jmespath.org/ for more
                                    information and examples.
    --verbose                     : Increase logging verbosity. Use --debug for full debug logs.

(env27) D:\Repos\azure-cli>az lab vm apply-artifacts --lab-name labname -n test-artifacts-vm -g lab --artifacts @C:\Users\vissha\Desktop\lab-nodejs-artifact.json

(env27) D:\Repos\azure-cli>

Please use the latest changed after PR has been merge and let us know if you still have problems. Thanks!

Since your PR is merged, @vishrutshah can this be closed?

Yes. PR is merged.

@lisawong19 Could you please use the latest bits and verify?

@vishrutshah: It works! Thanks

Was this page helpful?
0 / 5 - 0 ratings