Skip to content

Commit

Permalink
[storage-preview] Remove file-add command argument (Azure#835)
Browse files Browse the repository at this point in the history
* [storage-preview] Remove file-add command argument

* Fix tests

* Update readme

* Fix test

* Publish
  • Loading branch information
limingu authored and tjprescott committed Jul 6, 2019
1 parent 6ba0543 commit d0fee62
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 102 deletions.
104 changes: 52 additions & 52 deletions src/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -1642,8 +1642,8 @@
],
"storage-preview": [
{
"downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/storage_preview-0.2.7-py2.py3-none-any.whl",
"filename": "storage_preview-0.2.7-py2.py3-none-any.whl",
"downloadUrl": "https://azurecliprod.blob.core.windows.net/cli-extensions/storage_preview-0.2.8-py2.py3-none-any.whl",
"filename": "storage_preview-0.2.8-py2.py3-none-any.whl",
"metadata": {
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.0.52",
Expand Down Expand Up @@ -1682,9 +1682,9 @@
"metadata_version": "2.0",
"name": "storage-preview",
"summary": "Provides a preview for upcoming storage features.",
"version": "0.2.7"
"version": "0.2.8"
},
"sha256Digest": "19c9a8430cbeca59b39eef2a7f82b7ed4a4160c7701ddd791228d6339ba5c69f"
"sha256Digest": "a3d48247051e95847ded28217433c4b98fc02d6ee21eedfcb24dd43f7360569d"
}
],
"subscription": [
Expand Down Expand Up @@ -1826,53 +1826,6 @@
"sha256Digest": "f29f98cac402f6b22e3af37ec9f70e9d0aaafd44958b8e7737c98c9f4998b886"
}
],
"webapp": [
{
"downloadUrl": "https://github.com/ppvasude/azure-cli-extensions/raw/t-puvasu/extensions/src/webapp/dist/webapp-0.2.20-py2.py3-none-any.whl",
"filename": "webapp-0.2.20-py2.py3-none-any.whl",
"metadata": {
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.0.46",
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"License :: OSI Approved :: MIT License"
],
"extensions": {
"python.details": {
"contacts": [
{
"email": "sisirap@microsoft.com",
"name": "Sisira Panchagnula",
"role": "author"
}
],
"document_names": {
"description": "DESCRIPTION.rst"
},
"project_urls": {
"Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/webapp"
}
}
},
"generator": "bdist_wheel (0.30.0)",
"license": "MIT",
"metadata_version": "2.0",
"name": "webapp",
"summary": "Additional commands for Azure AppService.",
"version": "0.2.20"
},
"sha256Digest": "b939542ced2425b4c74c45dd987b11781b2607ef9974146cad373a6030fdf1f1"
}
],
"vm-repair": [
{
"downloadUrl": "https://azurecomputeaidrepair.blob.core.windows.net/prod/vm_repair-0.1.1-py2.py3-none-any.whl",
Expand Down Expand Up @@ -1917,7 +1870,54 @@
},
"sha256Digest": "22f956b98b4c9cad015317eab624384101e1ef5cacc23c63c205d0f5c0961b67"
}
],
"webapp": [
{
"downloadUrl": "https://github.com/ppvasude/azure-cli-extensions/raw/t-puvasu/extensions/src/webapp/dist/webapp-0.2.20-py2.py3-none-any.whl",
"filename": "webapp-0.2.20-py2.py3-none-any.whl",
"metadata": {
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.0.46",
"classifiers": [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"License :: OSI Approved :: MIT License"
],
"extensions": {
"python.details": {
"contacts": [
{
"email": "sisirap@microsoft.com",
"name": "Sisira Panchagnula",
"role": "author"
}
],
"document_names": {
"description": "DESCRIPTION.rst"
},
"project_urls": {
"Home": "https://github.com/Azure/azure-cli-extensions/tree/master/src/webapp"
}
}
},
"generator": "bdist_wheel (0.30.0)",
"license": "MIT",
"metadata_version": "2.0",
"name": "webapp",
"summary": "Additional commands for Azure AppService.",
"version": "0.2.20"
},
"sha256Digest": "b939542ced2425b4c74c45dd987b11781b2607ef9974146cad373a6030fdf1f1"
}
]
},
"formatVersion": "1"
}
}
4 changes: 4 additions & 0 deletions src/storage-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

0.2.8 (2019-7-5)
++++++++++++++++
* Remove file-add command argument

0.2.7 (2019-6-14)
+++++++++++++++++
* Remove min_profile
Expand Down
6 changes: 2 additions & 4 deletions src/storage-preview/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,11 @@ Enable AAD integration for Azure files, which will support SMB access: [more inf
az storage account create \
--name accountName \
--resource-group groupName \
--kind StorageV2 \
--file-aad
--kind StorageV2
az storage account update \
--name accountName \
--resource-group groupName \
--file-aad false
--resource-group groupName
```

#### Premium Blobs/Files:
Expand Down
4 changes: 0 additions & 4 deletions src/storage-preview/azext_storage_preview/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ def register_common_storage_account_options(self):

self.argument('https_only', help='Allows https traffic only to storage service.',
arg_type=get_three_state_flag())
self.argument('file_aad', arg_type=get_three_state_flag(),
help='Allows Azure File Active Directory integration, which will support SMB access to '
'azure files using AAD. Requires AAD domain service setup: "https://'
'docs.microsoft.com/en-us/azure/storage/files/storage-files-active-directory-enable"')
self.argument('sku', help='The storage account SKU.', arg_type=get_enum_type(t_sku_name))
self.argument('assign_identity', action='store_true', resource_type=CUSTOM_MGMT_STORAGE,
min_api='2017-06-01',
Expand Down
9 changes: 1 addition & 8 deletions src/storage-preview/azext_storage_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
c.argument('if_match')
c.argument('if_none_match')

for item in ['delete', 'show', 'update', 'show-connection-string', 'keys', 'network-rule', 'failover']:
for item in ['delete', 'show', 'update', 'keys', 'network-rule', 'failover']:
with self.argument_context('storage account {}'.format(item)) as c:
c.argument('account_name', acct_name_type, options_list=['--name', '-n'])
c.argument('resource_group_name', required=False, validator=process_resource_group)
Expand Down Expand Up @@ -119,13 +119,6 @@ def load_arguments(self, _): # pylint: disable=too-many-locals, too-many-statem
c.argument('expand', arg_type=get_enum_type(
self.get_models('StorageAccountExpand', resource_type=CUSTOM_MGMT_STORAGE)))

with self.argument_context('storage account show-connection-string') as c:
c.argument('protocol', help='The default endpoint protocol.', arg_type=get_enum_type(['http', 'https']))
c.argument('key_name', options_list=['--key'], help='The key to use.',
arg_type=get_enum_type(list(storage_account_key_options.keys())))
for item in ['blob', 'file', 'queue', 'table']:
c.argument('{}_endpoint'.format(item), help='Custom endpoint for {}s.'.format(item))

with self.argument_context('storage account keys renew') as c:
c.argument('key_name', options_list=['--key'], help='The key to regenerate.', validator=validate_key,
arg_type=get_enum_type(list(storage_account_key_options.keys())))
Expand Down
1 change: 0 additions & 1 deletion src/storage-preview/azext_storage_preview/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def get_custom_sdk(custom_module, client_factory, resource_type=CUSTOM_DATA_STOR
g.show_command('show', 'get_properties')
g.custom_command('list', 'list_storage_accounts')
g.custom_command('show-usage', 'show_storage_account_usage', min_api='2018-02-01')
g.custom_command('show-connection-string', 'show_storage_account_connection_string')
g.generic_update_command('update', getter_name='get_properties', setter_name='update',
custom_func_name='update_storage_account', min_api='2016-12-01')
g.command('keys renew', 'regenerate_key', transform=lambda x: getattr(x, 'keys', x))
Expand Down
11 changes: 3 additions & 8 deletions src/storage-preview/azext_storage_preview/operations/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
# pylint: disable=too-many-locals
def create_storage_account(cmd, resource_group_name, account_name, sku=None, location=None, kind=None,
tags=None, custom_domain=None, encryption_services=None, access_tier=None, https_only=None,
file_aad=None, hierarchical_namespace=None, bypass=None, default_action=None,
assign_identity=False):
hierarchical_namespace=None, bypass=None, default_action=None, assign_identity=False):
StorageAccountCreateParameters, Kind, Sku, CustomDomain, AccessTier, Identity, Encryption, NetworkRuleSet = \
cmd.get_models('StorageAccountCreateParameters', 'Kind', 'Sku', 'CustomDomain', 'AccessTier', 'Identity',
'Encryption', 'NetworkRuleSet')
Expand All @@ -30,8 +29,6 @@ def create_storage_account(cmd, resource_group_name, account_name, sku=None, loc
params.identity = Identity()
if https_only:
params.enable_https_traffic_only = https_only
if file_aad:
params.enable_azure_files_aad_integration = file_aad
if hierarchical_namespace:
params.is_hns_enabled = hierarchical_namespace

Expand Down Expand Up @@ -94,7 +91,7 @@ def show_storage_account_usage(cmd, location):
# pylint: disable=too-many-locals
def update_storage_account(cmd, instance, sku=None, tags=None, custom_domain=None, use_subdomain=None,
encryption_services=None, encryption_key_source=None, encryption_key_vault_properties=None,
access_tier=None, https_only=None, file_aad=None, assign_identity=False, bypass=None,
access_tier=None, https_only=None, assign_identity=False, bypass=None,
default_action=None):
StorageAccountUpdateParameters, Sku, CustomDomain, AccessTier, Identity, Encryption, NetworkRuleSet = \
cmd.get_models('StorageAccountUpdateParameters', 'Sku', 'CustomDomain', 'AccessTier', 'Identity',
Expand Down Expand Up @@ -125,9 +122,7 @@ def update_storage_account(cmd, instance, sku=None, tags=None, custom_domain=Non
custom_domain=domain,
encryption=encryption,
access_tier=AccessTier(access_tier) if access_tier is not None else instance.access_tier,
enable_https_traffic_only=https_only if https_only is not None else instance.enable_https_traffic_only,
enable_azure_files_aad_integration=file_aad if file_aad is not None
else instance.enable_azure_files_aad_integration
enable_https_traffic_only=https_only if https_only is not None else instance.enable_https_traffic_only
)
if assign_identity:
params.identity = Identity()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ def test_create_storage_account(self, resource_group, location):
JMESPathCheck('kind', 'Storage')
])

self.cmd('storage account show-connection-string -g {} -n {} --protocol http'.format(
resource_group, name), checks=[
JMESPathCheck("contains(connectionString, 'https')", False),
JMESPathCheck("contains(connectionString, '{}')".format(name), True)])

self.cmd('storage account update -g {} -n {} --tags foo=bar cat'
.format(resource_group, name),
checks=JMESPathCheck('tags', {'cat': '', 'foo': 'bar'}))
Expand Down Expand Up @@ -103,25 +98,6 @@ def test_create_storage_account_hierarchical_namespace(self, resource_group, loc
JMESPathCheck('reason', 'AlreadyExists')
])

@ResourceGroupPreparer(parameter_name_for_location='location')
def test_create_storage_account_file_aad(self, resource_group, location):
self.kwargs.update({
'name': self.create_random_name(prefix='cli', length=24),
'loc': location
})

self.cmd('storage account create -n {name} -g {rg} -l {loc} --kind StorageV2 --file-aad',
checks=[JMESPathCheck('kind', 'StorageV2'),
JMESPathCheck('enableAzureFilesAadIntegration', True)])

self.cmd('storage account check-name --name {name}', checks=[
JMESPathCheck('nameAvailable', False),
JMESPathCheck('reason', 'AlreadyExists')
])

self.cmd('storage account update -n {name} -g {rg} --file-aad false',
checks=[JMESPathCheck('enableAzureFilesAadIntegration', False)])

@ResourceGroupPreparer(parameter_name_for_location='location', location='northeurope')
def test_create_storage_account_premium_sku(self, resource_group, location):
self.kwargs.update({
Expand Down
2 changes: 1 addition & 1 deletion src/storage-preview/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from codecs import open
from setuptools import setup, find_packages

VERSION = "0.2.7"
VERSION = "0.2.8"

CLASSIFIERS = [
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit d0fee62

Please sign in to comment.