Skip to content

Commit

Permalink
[Compute] Deprecate --storage-caching option in VM create. (Azure#7119
Browse files Browse the repository at this point in the history
)

* Deprecate `--storage-caching` option in VM create.

* Fix linter rule.
  • Loading branch information
tjprescott authored Aug 22, 2018
1 parent cae9597 commit b1c69f1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/command_modules/azure-cli-vm/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Release History
2.2.2
++++++
* `vm/vmss identity show`: exception handling to exit with code 3 upon a missing resource for consistency
* `vm create`: deprecate `--storage-caching` option.

2.2.1
++++++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def load_arguments(self, _):
c.argument('use_unmanaged_disk', action='store_true', help='Do not use managed disk to persist VM')
c.argument('data_disk_sizes_gb', nargs='+', type=int, help='space-separated empty managed data disk sizes in GB to create')
c.ignore('disk_info', 'storage_account_type', 'public_ip_address_type', 'nsg_type', 'nic_type', 'vnet_type', 'load_balancer_type', 'app_gateway_type')
c.argument('os_caching', options_list=['--storage-caching', '--os-disk-caching'], help='Storage caching type for the VM OS disk. Default: ReadWrite', arg_type=get_enum_type(CachingTypes))
c.argument('os_caching', options_list=[self.deprecate(target='--storage-caching', redirect='--os-disk-caching', hide=True), '--os-disk-caching'], help='Storage caching type for the VM OS disk. Default: ReadWrite', arg_type=get_enum_type(CachingTypes))
c.argument('data_caching', options_list=['--data-disk-caching'], nargs='+',
help="storage caching type for data disk(s), including 'None', 'ReadOnly', 'ReadWrite', etc. Use a singular value to apply on all disks, or use '<lun>=<vaule1> <lun>=<value2>' to configure individual disk")

Expand Down
4 changes: 4 additions & 0 deletions tools/automation/cli_linter/rules/parameter_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ def expired_option(linter, command_name, parameter_name):

@parameter_rule
def bad_short_option(linter, command_name, parameter_name):
from knack.deprecation import Deprecated
bad_options = []
for option in linter.get_parameter_options(command_name, parameter_name):
if isinstance(option, Deprecated):
# we don't care if deprecated options are "bad options" since this is the mechanism by which we get rid of them
continue
if not option.startswith('--') and len(option) != 2:
bad_options.append(option)

Expand Down

0 comments on commit b1c69f1

Please sign in to comment.