Debian Codegraph @

spark/runners/__init__.py

raw
1 # -*- coding: utf-8 -*-
2 #
3 # Copyright (C) 2017-2020 Matthias Klumpp <[email protected]>
4 #
5 # Licensed under the GNU Lesser General Public License Version 3
6 #
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Lesser General Public License as published by
9 # the Free Software Foundation, either version 3 of the license, or
10 # (at your option) any later version.
11 #
12 # This software is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Lesser General Public License for more details.
16 #
17 # You should have received a copy of the GNU Lesser General Public License
18 # along with this software. If not, see <http://www.gnu.org/licenses/>.
19
20 import importlib
21
22 # Determine which runner is responsible for which job type.
23 PLUGINS = {
24 'package-build': 'spark.runners.debspawn',
25 'os-image-build': 'spark.runners.image_build',
26 }
27
28
29 def load_module(what):
30 path = PLUGINS[what]
31 mod = importlib.import_module(path)
32 return (mod.run, mod.get_version)