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

{SQL} fix az sql server ad-admin update , az sql server ad-admin create calls #12541

Merged
merged 7 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/sql/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ def _configure_security_policy_storage_params(arg_ctx):
with self.argument_context('sql server ad-admin create') as c:
# Create args that will be used to build up the ServerAzureADAdministrator object
create_args_for_complex_type(
c, 'properties', ServerAzureADAdministrator, [
c, 'parameters', ServerAzureADAdministrator, [
'login',
'sid',
amolagar5 marked this conversation as resolved.
Show resolved Hide resolved
])
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/sql/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def load_command_table(self, _):
g.command('delete', 'delete')
g.generic_update_command('update',
custom_func_name='server_ad_admin_update',
setter_arg_name='properties')
setter_arg_name='parameters')

server_keys_operations = CliCommandType(
operations_tmpl='azure.mgmt.sql.operations#ServerKeysOperations.{}',
Expand Down
6 changes: 2 additions & 4 deletions src/azure-cli/azure/cli/command_modules/sql/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2071,8 +2071,7 @@ def server_ad_admin_set(
return client.create_or_update(
server_name=server_name,
resource_group_name=resource_group_name,
properties=kwargs)

parameters=kwargs)

def server_ad_admin_update(
instance,
Expand All @@ -2082,15 +2081,14 @@ def server_ad_admin_update(
'''
Updates a server' AD admin.
'''

amolagar5 marked this conversation as resolved.
Show resolved Hide resolved
# Apply params to instance
instance.login = login or instance.login
instance.sid = sid or instance.sid
instance.tenant_id = tenant_id or instance.tenant_id

return instance


#####
# sql server firewall-rule
#####
Expand Down
Loading