Skip to content

Conversation

@NJLangley
Copy link
Contributor

@NJLangley NJLangley commented May 4, 2021

Description
Running az labs create environment ... to produce an environment from an ARM template produces an error on azure-cli 2.23.0 as below

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: __init__() takes 1 positional argument but 3 were given
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 657, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/__init__.py", line 807, in default_command_handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/lab/custom.py", line 93, in create_environment
TypeError: __init__() takes 1 positional argument but 3 were given
az_command_data_logger: __init__() takes 1 positional argument but 3 were given
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 657, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 720, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 691, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 328, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/__init__.py", line 807, in default_command_handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/lab/custom.py", line 93, in create_environment
TypeError: __init__() takes 1 positional argument but 3 were given

The error is fixed by making the parameters for creating the type EnvironmentDeploymentProperties from positional parameters to named parameters

Testing Guide
I have made the change and run the command from a VSCode debug session. I can now successfully create an environment.


This checklist is used to make sure that common guidelines for a pull request are followed.

…al to named to fix error __init__() from init
@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label May 4, 2021
@ghost
Copy link

ghost commented May 4, 2021

Thank you for your contribution NJLangley! We will review the pull request and get back to you soon.

@yonzhan yonzhan requested a review from zhoxing-ms May 5, 2021 00:02
@yonzhan yonzhan added this to the S187 milestone May 5, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented May 5, 2021

DevTestLabs

@yonzhan yonzhan requested a review from jsntcy May 5, 2021 00:02
@NJLangley
Copy link
Contributor Author

One of the tests unrelated to my change is failing, do I need to rebase onto the latest dev?

@zhoxing-ms zhoxing-ms merged commit 387c49f into Azure:dev May 11, 2021
@zhoxing-ms
Copy link
Contributor

One of the tests unrelated to my change is failing, do I need to rebase onto the latest dev?

No. This is a ADO problem, which has been solved after rerun.

@NJLangley NJLangley deleted the labs-environement-create-fix branch May 11, 2021 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants