-
Notifications
You must be signed in to change notification settings - Fork 3.3k
ResourceGroup Commands: create, delete, exists, show #195
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e306c9f
Expose resouce group 'create', 'delete', 'show' and 'exists' commands.
tjprescott 03c416c
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott e05bf83
Convert decorator style custom commands to semi-automatic custom comm…
tjprescott d6d0c07
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott a7352ce
Post-merge fixes. Fix bug where request URI differs between Python 2 …
tjprescott ea0f976
Resolve CR comments.
tjprescott 15cfc69
Code review comments.
tjprescott 2ab48c3
Add tag commands.
tjprescott d3374ea
Add simple deployment and deployment operation commands.
tjprescott 21c40e0
fix alias of deployment operation to resource group deployment operat…
tjprescott ab936c4
Update generate_command_inventory to allow filtering out commands tha…
tjprescott 79cab04
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott 41e62a9
Post-merge fixes.
tjprescott bcc237d
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott 8d22a8b
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott 2a7bb9f
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott 04b5d73
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott 0cf4c42
Merge branch 'master' of https://github.com/tjprescott/azure-cli into…
tjprescott 02c19a7
Thanks GIT!
tjprescott File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| def validate_tags(string): | ||
| ''' Extracts multiple tags in key[=value] format, separated by semicolons ''' | ||
| result = None | ||
| if string: | ||
| result = validate_key_value_pairs(string) | ||
| s_list = [x for x in string.split(';') if '=' not in x] # single values | ||
| result.update(dict((x, '') for x in s_list)) | ||
| return result | ||
|
|
||
| def validate_tag(string): | ||
| ''' Extracts a single tag in key[=value] format ''' | ||
| result = None | ||
| if string: | ||
| comps = string.split('=', 1) | ||
| result = {comps[0]: comps[1]} if len(comps) > 1 else {string: ''} | ||
| return result | ||
|
|
||
| def validate_key_value_pairs(string): | ||
| ''' Validates key-value pairs in the following format: a=b;c=d ''' | ||
| result = None | ||
| if string: | ||
| kv_list = [x for x in string.split(';') if '=' in x] # key-value pairs | ||
| result = dict(x.split('=', 1) for x in kv_list) | ||
| return result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import unittest | ||
| from six import StringIO | ||
|
|
||
| from azure.cli.commands._validators import * | ||
|
|
||
| class Test_storage_validators(unittest.TestCase): | ||
|
|
||
| @classmethod | ||
| def setUpClass(cls): | ||
| pass | ||
|
|
||
| @classmethod | ||
| def tearDownClass(cls): | ||
| pass | ||
|
|
||
| def setUp(self): | ||
| self.io = StringIO() | ||
|
|
||
| def tearDown(self): | ||
| self.io.close() | ||
|
|
||
| def test_key_value_pairs_valid(self): | ||
| input = 'a=b;c=d' | ||
| actual = validate_key_value_pairs(input) | ||
| expected = {'a':'b', 'c':'d'} | ||
| self.assertEqual(actual, expected) | ||
|
|
||
| def test_key_value_pairs_invalid(self): | ||
| input = 'a=b;c=d;e' | ||
| actual = validate_key_value_pairs(input) | ||
| expected = {'a':'b', 'c':'d'} | ||
| self.assertEqual(actual, expected) | ||
|
|
||
| def test_tags_valid(self): | ||
| input = 'a=b;c=d;e' | ||
| actual = validate_tags(input) | ||
| expected = {'a':'b', 'c':'d', 'e':''} | ||
| self.assertEqual(actual, expected) | ||
|
|
||
| def test_tags_invalid(self): | ||
| input = '' | ||
| actual = validate_tags(input) | ||
| expected = None | ||
| self.assertEqual(actual, expected) | ||
|
|
||
| def test_tag(self): | ||
| self.assertEqual(validate_tag('test'), {'test':''}) | ||
| self.assertEqual(validate_tag('a=b'), {'a':'b'}) | ||
| self.assertEqual(validate_tag('a=b;c=d'), {'a':'b;c=d'}) | ||
|
|
||
| if __name__ == '__main__': | ||
| unittest.main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code shouldn't be commented out as Burt has fixed the test failing.
Have you merged with the latest from master branch?