Skip to content
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'''


def get_github_access_token(cmd, scope_list=None):
def get_github_access_token(cmd, scope_list=None): # pylint: disable=unused-argument
Copy link
Member

Choose a reason for hiding this comment

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

How about remove cmd parameter directly? As far as I know, custom function is allowed to not contain cmd according to

def default_command_handler(command_args):
from azure.cli.core.util import get_arg_list, augment_no_wait_handler_args
from azure.cli.core.commands.client_factory import resolve_client_arg_name
op = handler or self.get_op_handler(operation, operation_group=kwargs.get('operation_group'))
op_args = get_arg_list(op)
cmd = command_args.get('cmd') if 'cmd' in op_args else command_args.pop('cmd')
client = client_factory(cmd.cli_ctx, command_args) if client_factory else None
supports_no_wait = kwargs.get('supports_no_wait', None)
if supports_no_wait:
no_wait_enabled = command_args.pop('no_wait', False)
augment_no_wait_handler_args(no_wait_enabled, op, command_args)
if client:
client_arg_name = resolve_client_arg_name(operation, kwargs)
if client_arg_name in op_args:
command_args[client_arg_name] = client
return op(**command_args)

L813 will process smartly

Copy link
Member Author

@jiasli jiasli May 7, 2021

Choose a reason for hiding this comment

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

This get_github_access_token is not used anywhere. Leave it to the author @calvinsID to further decide.

if scope_list:
for scope in scope_list:
if scope not in GITHUB_OAUTH_SCOPES:
Expand All @@ -30,11 +30,9 @@ def get_github_access_token(cmd, scope_list=None):
'client_id': GITHUB_OAUTH_CLIENT_ID
}

import base64
import json
import requests
import time
from urllib.parse import urlparse, parse_qs
from urllib.parse import parse_qs

try:
response = requests.post(authorize_url, data=authorize_url_data)
Expand Down