finalize signature of DownstreamRunner; remove **kwargs usage
This commit is contained in:
parent
76592c888d
commit
b2c47bde10
|
@ -75,18 +75,16 @@ def load_matrix_schema(repo):
|
||||||
return schema
|
return schema
|
||||||
|
|
||||||
class DownstreamRunner:
|
class DownstreamRunner:
|
||||||
# TODO: actualize args vs **kwargs
|
def __init__(self, repo, yaml_source, jobs, matrix_exclude=None, dry_run=False):
|
||||||
def __init__(self, **kwargs):
|
self.repo = repo
|
||||||
self.yaml_source = kwargs.get("yaml_source", None)
|
self.yaml_source = yaml_source
|
||||||
if self.yaml_source == None:
|
self.matrix_exclude = matrix_exclude
|
||||||
raise SystemExit("No YAML source provided.")
|
self.job_names = jobs
|
||||||
|
self.dry_run = dry_run
|
||||||
|
|
||||||
self._yaml_tree = None
|
self._yaml_tree = None
|
||||||
self.repo = kwargs.get("repo")
|
|
||||||
self.matrix_exclude = kwargs.get("matrix_exclude")
|
|
||||||
self.job_names = kwargs.get("jobs")
|
|
||||||
self._matrix = None
|
self._matrix = None
|
||||||
self._steps = None
|
self._steps = None
|
||||||
self.dry_run = kwargs.get("dry_run", False)
|
|
||||||
self.matrix_schema = load_matrix_schema(self.repo)
|
self.matrix_schema = load_matrix_schema(self.repo)
|
||||||
|
|
||||||
|
|
||||||
|
@ -263,13 +261,12 @@ if __name__ == "__main__":
|
||||||
cli_args = parser.parse_args()
|
cli_args = parser.parse_args()
|
||||||
if cli_args.dry_run:
|
if cli_args.dry_run:
|
||||||
logger.setLevel("DEBUG")
|
logger.setLevel("DEBUG")
|
||||||
runner_args = {
|
runner = DownstreamRunner(
|
||||||
"repo": cli_args.repo,
|
cli_args.repo,
|
||||||
"yaml_source": cli_args.source[0],
|
cli_args.source[0],
|
||||||
"jobs": cli_args.jobs,
|
cli_args.jobs,
|
||||||
"matrix_exclude": cli_args.matrix_exclude,
|
matrix_exclude=cli_args.matrix_exclude,
|
||||||
"dry_run": cli_args.dry_run,
|
dry_run=cli_args.dry_run,
|
||||||
}
|
)
|
||||||
runner = DownstreamRunner(**runner_args)
|
|
||||||
|
|
||||||
runner.run()
|
runner.run()
|
Loading…
Reference in New Issue