Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
norshtein committed Jul 17, 2020
1 parent f1bad1c commit 3f3efc8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/aks-preview/azext_aks_preview/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,11 @@ def validate_max_surge(namespace):
except ValueError:
raise CLIError("--max-surge should be an int or percentage")


def validate_assign_identity(namespace):
if namespace.assign_identity is not None:
if namespace.assign_identity == '':
return
from msrestazure.tools import is_valid_resource_id
if not is_valid_resource_id(namespace.assign_identity):
raise CLIError("--assign-identity is not a valid Azure resource ID.")
raise CLIError("--assign-identity is not a valid Azure resource ID.")
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,12 @@ def test_throws_on_negative(self):
validators.validate_max_surge(MaxSurgeNamespace("-3"))
self.assertTrue('positive' in str(cm.exception), msg=str(cm.exception))


class AssignIdentityNamespace:
def __init__(self, assign_identity):
self.assign_identity = assign_identity


class TestAssignIdentity(unittest.TestCase):
def test_invalid_identity_id(self):
invalid_identity_id = "dummy identity id"
Expand Down

0 comments on commit 3f3efc8

Please sign in to comment.