Skip to content

Commit

Permalink
repos: Avoid misspelled typ to circumvent built-in function name
Browse files Browse the repository at this point in the history
Just a style fix, no functional changes.

Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
jan-kiszka committed Dec 11, 2023
1 parent c304a60 commit 7984653
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kas/repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def factory(name, repo_config, repo_defaults, repo_fallback_path,

url = repo_config.get('url', None)
name = repo_config.get('name', name)
typ = repo_config.get('type', 'git')
repo_type = repo_config.get('type', 'git')
commit = repo_config.get('commit', None)
tag = repo_config.get('tag', None)
branch = repo_config.get('branch', repo_defaults.get('branch', None))
Expand Down Expand Up @@ -223,13 +223,14 @@ def factory(name, repo_config, repo_defaults, repo_fallback_path,
url = path
disable_operations = True

if typ == 'git':
if repo_type == 'git':
return GitRepo(name, url, path, commit, tag, branch, refspec,
layers, patches, disable_operations)
if typ == 'hg':
if repo_type == 'hg':
return MercurialRepo(name, url, path, commit, tag, branch, refspec,
layers, patches, disable_operations)
raise UnsupportedRepoTypeError(f'Repo type "{typ}" not supported.')
raise UnsupportedRepoTypeError(f'Repo type "{repo_type}" '
'not supported.')

@staticmethod
def get_root_path(path, fallback=True):
Expand Down

0 comments on commit 7984653

Please sign in to comment.