pylint flake8 fixes
This commit is contained in:
Родитель
109ae0f7c9
Коммит
7c0ea38830
|
@ -49,7 +49,7 @@ def get_helm_charts(language, acr_details, port):
|
|||
# r=root, d=directories, f = files
|
||||
logger.debug("Checking in helm charts")
|
||||
for r, _d, f in os.walk(abs_pack_path):
|
||||
if not 'charts' in r:
|
||||
if 'charts' not in r:
|
||||
continue
|
||||
for file in f:
|
||||
if '__pycache__' not in r and '__init__.py' not in file:
|
||||
|
|
|
@ -123,7 +123,6 @@ def aks_deploy(aks_cluster=None, acr=None, repository=None, port=None, branch_na
|
|||
print('Your app is deployed at: http://{ip}:{port}'.format(ip=deployment_ip, port=port))
|
||||
return
|
||||
|
||||
|
||||
def get_yaml_template_for_repo(cluster_details, acr_details):
|
||||
files_to_return = []
|
||||
github_workflow_path = '.github/workflows/'
|
||||
|
|
|
@ -145,7 +145,7 @@ def configure_aks_credentials(cluster_name, resource_group):
|
|||
subscription_id, subscription_name, tenant_id, environment_name = get_default_subscription_info()
|
||||
logger.warning("Using your default Azure subscription %s for getting AKS cluster credentials.",
|
||||
subscription_name)
|
||||
aks_creds = subprocess.check_output(
|
||||
_aks_creds = subprocess.check_output(
|
||||
'az aks get-credentials -n {cluster_name} -g {group_name} -o json'.format(
|
||||
cluster_name=cluster_name, group_name=resource_group), shell=True)
|
||||
except Exception as ex:
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# --------------------------------------------------------------------------------------------
|
||||
import requests
|
||||
import time
|
||||
import requests
|
||||
from knack.log import get_logger
|
||||
from knack.util import CLIError
|
||||
from azext_aks_deploy.dev.common.prompting import prompt_not_empty
|
||||
|
@ -147,13 +147,12 @@ def get_default_branch(repo):
|
|||
CLIError(ex)
|
||||
|
||||
def commit_files_to_github_branch(files, repo_name, branch, message):
|
||||
if files:
|
||||
for file in files:
|
||||
commit_sha = commit_file_to_github_branch(file.path, file.content, repo_name, branch, message)
|
||||
# returning last commit sha
|
||||
return commit_sha
|
||||
else:
|
||||
if not files:
|
||||
raise CLIError("No files to checkin.")
|
||||
for file in files:
|
||||
commit_sha = commit_file_to_github_branch(file.path, file.content, repo_name, branch, message)
|
||||
# returning last commit sha
|
||||
return commit_sha
|
||||
|
||||
def check_file_exists(repo_name, file_path):
|
||||
"""
|
||||
|
@ -201,10 +200,9 @@ def commit_file_to_github_branch(path_to_commit, content, repo_name, branch, mes
|
|||
if not response.status_code == _HTTP_CREATED_STATUS:
|
||||
raise CLIError('GitHub file checkin failed for file ({file}). Status Code ({code}).'.format(
|
||||
file=path_to_commit, code=response.status_code))
|
||||
else:
|
||||
commit_obj = response.json()['commit']
|
||||
commit_sha = commit_obj['sha']
|
||||
return commit_sha
|
||||
commit_obj = response.json()['commit']
|
||||
commit_sha = commit_obj['sha']
|
||||
return commit_sha
|
||||
else:
|
||||
raise CLIError('GitHub file checkin failed. File path or content is empty.')
|
||||
|
||||
|
|
|
@ -45,4 +45,3 @@ def get_azure_credentials():
|
|||
azure_creds_user_choice = prompt_user_friendly_choice_list(
|
||||
'Have you copied the name and value for AZURE_CREDENTIALS, REGISTRY_USERNAME and REGISTRY_PASSWORD:',
|
||||
user_choice_list)
|
||||
return
|
||||
|
|
Загрузка…
Ссылка в новой задаче