-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
563 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.env | ||
.toolset*.yml | ||
.idea | ||
.PKGINFO | ||
.SIGN.RSA.alpine-* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Copyright (C) 2019 Evgeny Golyshev <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import os | ||
import sys | ||
from argparse import ArgumentParser | ||
|
||
from yaml.scanner import ScannerError | ||
|
||
from pieman import toolset, util | ||
|
||
|
||
def main(): | ||
"""The main entry point. """ | ||
|
||
parser = ArgumentParser() | ||
parser.add_argument('yml_file', help='path to the Toolset YAML file') | ||
args = parser.parse_args() | ||
|
||
try: | ||
os.environ['TOOLSET_FULL_PATH'] | ||
except KeyError: | ||
util.fatal('The TOOLSET_FULL_PATH environment variable is undefined.') | ||
sys.exit(1) | ||
|
||
try: | ||
toolset_tree = toolset.ToolsetProcessor(args.yml_file) | ||
except ScannerError as exp: | ||
util.fatal('{}'.format(exp)) | ||
sys.exit(1) | ||
except AttributeError as exp: | ||
util.fatal('{}'.format(exp)) | ||
sys.exit(1) | ||
except ModuleNotFoundError as exp: | ||
util.fatal('{}'.format(exp)) | ||
sys.exit(1) | ||
except toolset.MissingRequiredFields as exp: | ||
util.fatal('{}'.format(exp)) | ||
sys.exit(1) | ||
|
||
for name, module in toolset_tree: | ||
for flavour in module['flavours']: | ||
flavour_name = next(iter(flavour)) | ||
mod = module['imported'] | ||
mod.run(**flavour[flavour_name]) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (C) 2019 Evgeny Golyshev <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import sys | ||
from argparse import ArgumentParser | ||
|
||
from yaml.scanner import ScannerError | ||
|
||
from pieman import toolset | ||
|
||
|
||
def main(): | ||
"""The main entry point. """ | ||
|
||
parser = ArgumentParser() | ||
parser.add_argument('infile', help='path to the file to be processed') | ||
parser.add_argument('outfile', help='path to the result file') | ||
args = parser.parse_args() | ||
|
||
try: | ||
toolset.PreProcessor(args.infile, args.outfile) | ||
except ScannerError as exp: | ||
sys.stderr.write('{}\n'.format(exp)) | ||
sys.exit(1) | ||
except toolset.UndefinedVariable as exp: | ||
sys.stderr.write('{}\n'.format(exp)) | ||
sys.exit(1) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
"""The Pieman tools. """ | ||
|
||
__version__ = '0.10.0' | ||
__version__ = '0.11.0' |
Oops, something went wrong.