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

Fix Nic creation issue in stack #4008

Merged
merged 5 commits into from
Jul 13, 2017
Merged

Fix Nic creation issue in stack #4008

merged 5 commits into from
Jul 13, 2017

Conversation

viananth
Copy link
Member

Nic creation in Azure Stack failed because network api supported by stack doesn't recognize 'enable_accelerated_networking' argument for nic creation. This fix adds a check for supported api version.

Closes #4007


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

General Guidelines

  • The PR has modified HISTORY.rst with an appropriate description of the change (see Modifying change log).

Command Guidelines

  • Each command and parameter has a meaningful description.
  • Each new command has a test.

(see Authoring Command Modules)

@msftclas
Copy link

@viananth,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@derekbekoe
Copy link
Member

This change needs tests IMHO as that's likely why it wasn't caught in the first place.
A test for the stack profile would prevent this regression in the future.

nic = NetworkInterface(location=location, tags=tags, enable_ip_forwarding=enable_ip_forwarding,
dns_settings=dns_settings, enable_accelerated_networking=enable_accelerated_networking)
Copy link
Member

@tjprescott tjprescott Jul 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be more concise and consistent with the rest of the CLI patterns:

nic = NetworkInterface(location=location, tags=tags, enable_ip_forwarding=enable_ip_forwarding, dns_settings=dns_settings)

if supported_api_version(ResourceType.MGMT_NETWORK, min_api='2016-09-01'):
  nic.enable_accelerated_networking = enable_accelerated_networking

Copy link
Member

@tjprescott tjprescott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be more concise and consistent with the rest of the CLI patterns:

nic = NetworkInterface(location=location, tags=tags, enable_ip_forwarding=enable_ip_forwarding, dns_settings=dns_settings)

if supported_api_version(ResourceType.MGMT_NETWORK, min_api='2016-09-01'):
  nic.enable_accelerated_networking = enable_accelerated_networking

@codecov-io
Copy link

codecov-io commented Jul 11, 2017

Codecov Report

Merging #4008 into master will decrease coverage by 0.08%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4008      +/-   ##
==========================================
- Coverage   70.59%   70.51%   -0.09%     
==========================================
  Files         427      428       +1     
  Lines       27541    27561      +20     
  Branches     4213     4219       +6     
==========================================
- Hits        19443    19434       -9     
- Misses       6837     6873      +36     
+ Partials     1261     1254       -7
Impacted Files Coverage Δ
...etwork/azure/cli/command_modules/network/custom.py 55.15% <50%> (-0.01%) ⬇️
...dules/azure-cli-interactive/azclishell/az_lexer.py 84.61% <0%> (-15.39%) ⬇️
...ules/azure-cli-interactive/azclishell/argfinder.py 31.57% <0%> (-10.53%) ⬇️
...s/azure-cli-interactive/azclishell/az_completer.py 53.98% <0%> (-7.01%) ⬇️
...modules/azure-cli-interactive/azclishell/layout.py 42.71% <0%> (-0.85%) ⬇️
...dules/azure-cli-interactive/azclishell/progress.py 43.37% <0%> (-0.38%) ⬇️
...nent/azure/cli/command_modules/component/custom.py 16.23% <0%> (ø) ⬆️
...zure-cli-interactive/azclishell/gather_commands.py 48.73% <0%> (ø) ⬆️
...dback/azure/cli/command_modules/feedback/custom.py 31.25% <0%> (ø) ⬆️
src/azure-cli-core/azure/cli/core/util.py 70.66% <0%> (ø) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08769b3...0c9fece. Read the comment docs.

@tjprescott
Copy link
Member

@derekbekoe enabling multi-cloud testing is something for us to do, but yes, now that stack has been merged we are overdue for it. @troydai where is that on the roadmap?

@tjprescott
Copy link
Member

Also, the existing NIC test would have caught the regression if it were run on the stack profile since it didn't have any API restrictions. However, right now it is just reliant upon us remembering to manually test on the other profile which is not a sustainable plan moving forward.

For @viananth, this does mean that you should also add the appropriate version constraint to the NetworkNicScenarioTest in the network tests.

@derekbekoe
Copy link
Member

@tjprescott multi-cloud testing should already be there but @troydai can confirm.

@troydai
Copy link
Contributor

troydai commented Jul 13, 2017

No plan for multi-cloud testing for now. But I'm all ears.

@viananth
Copy link
Member Author

@tjprescott @derekbekoe I'm working on the creating tests for stack cloud. But meanwhile, could we please merge this PR as this is breaking our customers?

@tjprescott tjprescott merged commit 168a6b4 into Azure:master Jul 13, 2017
@viananth viananth deleted the nic_fix branch July 13, 2017 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants