Skip to content

Put docstring into a single line #23

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 1 commit into from
Oct 15, 2022
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
40 changes: 10 additions & 30 deletions argocd/services/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ def __init__(self, token=None):
self.session.headers.update({"Authorization": f"Bearer {token}"})

def list(self, repo=None, force_refresh=False):
"""
ListRepositories gets a list of all configured repositories
"""
"""ListRepositories gets a list of all configured repositories"""
params = {}
if repo:
params["repo"] = repo
Expand All @@ -28,9 +26,7 @@ def list(self, repo=None, force_refresh=False):
return response.json()

def create(self, payload, upsert=False, creds_only=False):
"""
CreateRepository creates a new repository configuration
"""
"""CreateRepository creates a new repository configuration"""
params = {}
if upsert:
params["upsert"] = upsert
Expand All @@ -43,18 +39,14 @@ def create(self, payload, upsert=False, creds_only=False):
return response.json()

def update(self, repo, payload):
"""
UpdateRepository updates a repository configuration
"""
"""UpdateRepository updates a repository configuration"""
response = self.session.put(
f"{self.base_url}/api/v1/repositories/{repo}", json=payload
)
return response.json()

def get(self, repo, force_refresh=False):
"""
Get returns a repository or its credentials
"""
"""Get returns a repository or its credentials"""
params = {}
if force_refresh:
params["forceRefresh"] = force_refresh
Expand All @@ -65,9 +57,7 @@ def get(self, repo, force_refresh=False):
return response.json()

def delete(self, repo, force_refresh=False):
"""
DeleteRepository deletes a repository from the configuration
"""
"""DeleteRepository deletes a repository from the configuration"""
params = {}
if force_refresh:
params["forceRefresh"] = force_refresh
Expand All @@ -78,9 +68,7 @@ def delete(self, repo, force_refresh=False):
return response.json()

def list_apps(self, repo, revision=None):
"""
ListApps returns list of apps in the repo
"""
"""ListApps returns list of apps in the repo"""
params = {}
if revision:
params["revision"] = revision
Expand All @@ -91,9 +79,7 @@ def list_apps(self, repo, revision=None):
return response.json()

def list_charts(self, repo, force_refresh=False):
"""
GetHelmCharts returns list of helm charts in the specified repository
"""
"""GetHelmCharts returns list of helm charts in the specified repository"""
params = {}
if force_refresh:
params["forceRefresh"] = force_refresh
Expand All @@ -104,9 +90,7 @@ def list_charts(self, repo, force_refresh=False):
return response.json()

def list_refs(self, repo, force_refresh=False):
"""
RepositoryService_ListRefs
"""
"""RepositoryService_ListRefs"""
params = {}
if force_refresh:
params["forceRefresh"] = force_refresh
Expand Down Expand Up @@ -135,9 +119,7 @@ def validate_access(
proxy="",
project="",
):
"""
ValidateAccess validates access to a repository with given parameters
"""
"""ValidateAccess validates access to a repository with given parameters"""
params = {}
if username != "":
params["username"] = username
Expand Down Expand Up @@ -175,9 +157,7 @@ def validate_access(
return response.json()

def get_app(self, repo, payload):
"""
GetAppDetails returns application details by given path
"""
"""GetAppDetails returns application details by given path"""
response = self.session.post(
f"{self.base_url}/api/v1/repositories{repo}/appdetails", json=payload
)
Expand Down