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

Add wait commands and --no-wait support #2524

Merged
merged 2 commits into from Mar 16, 2017

Conversation

@tjprescott
Copy link
Member

commented Mar 15, 2017

Adds wait command for the following: express-route, local-gateway, vnet-gateway, vmss

Add --no-wait parameters to the following:
vm: create, delete, deallocate, generalize, stop, start, restart, redeploy, resize
vm user: update, delete, reset-ssh
vmss: create, delete, update, deallocate, delete-instances, stop, restart, start, update-instances, reimage, scale
vnet-gateway: delete
local-gateway: create, delete, update
express-route: create, delete, update

@tjprescott tjprescott added this to the Sprint 14 milestone Mar 15, 2017
@tjprescott tjprescott requested a review from troydai Mar 15, 2017
@tjprescott tjprescott referenced this pull request Mar 15, 2017
19 of 23 tasks complete
@tjprescott tjprescott force-pushed the tjprescott:WaitNoWait branch from e539fd7 to 6e7c56e Mar 15, 2017
@tjprescott tjprescott force-pushed the tjprescott:WaitNoWait branch from c0d2e93 to b1cfa90 Mar 16, 2017
@codecov-io

This comment has been minimized.

Copy link

commented Mar 16, 2017

Codecov Report

Merging #2524 into master will decrease coverage by 0.06%.
The diff coverage is 83.09%.

@@            Coverage Diff             @@
##           master    #2524      +/-   ##
==========================================
- Coverage   72.09%   72.02%   -0.07%     
==========================================
  Files         362      362              
  Lines       19758    19764       +6     
  Branches     2909     2912       +3     
==========================================
- Hits        14244    14236       -8     
- Misses       4600     4610      +10     
- Partials      914      918       +4
Impacted Files Coverage Δ
...etwork/azure/cli/command_modules/network/custom.py 61.62% <100%> (ø)
...re-cli-vm/azure/cli/command_modules/vm/commands.py 90.47% <100%> (-1.74%)
...work/azure/cli/command_modules/network/commands.py 98.98% <100%> (+0.01%)
...zure-cli-vm/azure/cli/command_modules/vm/custom.py 73.82% <64.28%> (-0.69%)
src/azure-cli-core/azure/cli/core/commands/arm.py 88% <80%> (-0.83%)

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 d0357fe...b1cfa90. Read the comment docs.

Copy link
Contributor

left a comment

Left one question on 'generic update' logic, the rest LGTM

ordered_arguments = args.pop('ordered_arguments', [])
for item in ['properties_to_add', 'properties_to_set', 'properties_to_remove']:
if args[item]:
raise CLIError("Unexpected '{}' was not empty.".format(item))

This comment has been minimized.

Copy link
@yugangw-msft

yugangw-msft Mar 16, 2017

Contributor

Shall we just say '{}' was not expected'. I don't know much about generic update though, but in case it helps
Also why we want to error out here? I assume we will apply their values on sending out the update payload?

This comment has been minimized.

Copy link
@tjprescott

tjprescott Mar 16, 2017

Author Member

There's an Action somewhere that removes the entries in these lists and puts them into the "ordered_args" argument. So if anything was left in these, I want to raise an error so I know there's a bug in the generic update logic before I delete them.


try:
client = factory() if factory else None
except TypeError:
client = factory(None) if factory else None

getterargs = {key: val for key, val in args.items()
if key in get_arguments_loader()}
getterargs = {key: val for key, val in args.items() if key in get_arguments_loader()}

This comment has been minimized.

Copy link
@troydai

troydai Mar 16, 2017

Contributor

What's the cost of get_arguments_loader()? Can we call it once and save the result?

This comment has been minimized.

Copy link
@tjprescott

tjprescott Mar 16, 2017

Author Member

We are only calling it once in the handler. This method doesn't get the "argument_loader" in the sense that "get_foo" would get the foo. It returns the CLI Arguments for the "get" side of the update. There's a corresponding "set_arguments_loader" that returns the CLI Arguments for the "set" side of the update. That's also only called once in the handler.

@tjprescott tjprescott merged commit ac03b51 into Azure:master Mar 16, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@tjprescott tjprescott deleted the tjprescott:WaitNoWait branch Mar 16, 2017
thegalah pushed a commit to thegalah/azure-cli that referenced this pull request Mar 21, 2017
* Azure/master: (478 commits)
  vm live test: allow more valid power states on vmss test verifications (Azure#2564)
  rbac:catch more graph error (Azure#2567)
  appservice: support to create plan when create a webapp (Azure#2550)
  Update storage tests (Azure#2556)
  Change PEP8 check filter from whitelist to blacklist (Azure#2557)
  Add scenario tests documentation (Azure#2555)
  [ACS] Adding support for configuring a default ACS cluster (Azure#2554)
  [ACS] Provide a short name alias for the orchestrator type flag (Azure#2553)
  Sql Import/Export CLI commands and test (Azure#2538)
  Fix format bug. (Azure#2549)
  [VM/VMSS] Improved disk caching support (Azure#2522)
  VM/VMSS: incorporate credentials validation logic used by portal (Azure#2537)
  Script that creates packaged releases package archive (Azure#2508)
  Adding alias for defaults flag (Azure#2540)
  Add wait commands and --no-wait support (Azure#2524)
  choice list outside of named arguments (Azure#2521)
  Fixed test failure in test_sql_db_mgmt. (Azure#2530)
  core: support login using service principal with a cert (Azure#2457)
  Add note about being in preview (Azure#2512)
  vm:fix distro check mechanism used by disk encryption (Azure#2511)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.