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 blob type validator #1656

Merged
merged 2 commits into from
Jan 5, 2017
Merged

Fix blob type validator #1656

merged 2 commits into from
Jan 5, 2017

Conversation

djyou
Copy link
Member

@djyou djyou commented Jan 5, 2017

The blob_type cannot be set to append because of this validator, such as in az storage blob upload command by --type argument.

@@ -122,7 +122,8 @@ def validate_source_uri(namespace):
namespace.copy_source = uri

def validate_blob_type(namespace):
namespace.blob_type = 'page' if namespace.file_path.endswith('.vhd') else 'block'
if namespace.blob_type is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

use if not namespace.blob_type instead of is None

@tjprescott
Copy link
Member

To fix the error, it looks like you need to re-record the blob scenario test. In the storage test recordings delete the test_storage_blob_scenario.yaml file and then run:
python -m unittest azure.cli.command_modules.storage.tests.test_storage.StorageBlobScenarioTest

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.

Onboard with the change. Just please re-record the associated test.

@tjprescott tjprescott merged commit cbd9796 into Azure:master Jan 5, 2017
thegalah pushed a commit to thegalah/azure-cli that referenced this pull request Jan 6, 2017
* Azure/master:
  Fix PEP8 for azure-cli (Azure#1661)
  [VM/VMSS] Enable Multi-Cloud VM/VMSS Create (Azure#1654)
  Fix blob type validator (Azure#1656)
  Improve @file handling logic (Azure#1648)
  Name private_config.json differently in VM test (Azure#1653)
  Update regex of parsing sdk function argument comments (Azure#1650)
  Reorganize test run in automation (Azure#1624)
  Fix issue 1644. (Azure#1647)
  [Network] VNet Gateway Fixes and Enhancements (Azure#1643)
  [Network] Application Gateway Commands and Fixes (Azure#1606)
  [Docs] Correcting unittest location in docs (Azure#1642)
  [ACS] Add a table transform for acs show to match acs list. (Azure#1641)
  [ACS] Add a unit test and fix a bug with az browse ... (Azure#1640)
  [Component] Fix pip seg fault on 'az component update' (Azure#1639)
  fixed typo (Azure#1634)
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.

5 participants