diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-08-03 16:24:08 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-08-03 16:24:08 +0200 |
commit | 57a283a5634d47f559557f966e64d621843e4035 (patch) | |
tree | 9a93ab9fe570ceb67ef01b963f084b5fa6d4c4c9 /pyenc/cmdline.py | |
parent | work (diff) | |
download | puppet-classifier-57a283a5634d47f559557f966e64d621843e4035.tar.gz puppet-classifier-57a283a5634d47f559557f966e64d621843e4035.tar.xz |
work
Diffstat (limited to 'pyenc/cmdline.py')
-rw-r--r-- | pyenc/cmdline.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/pyenc/cmdline.py b/pyenc/cmdline.py new file mode 100644 index 0000000..099018d --- /dev/null +++ b/pyenc/cmdline.py @@ -0,0 +1,29 @@ +import click +from flask.cli import AppGroup + +app_group = AppGroup('user', help="Testt") + +@app_group.command('enc') +@click.argument('fqdn') +def enc(fqdn): + from . import enc + enc.run_enc(fqdn) + +@app_group.command('init-db') +def initialize_database(): + from . import model + model.db.create_all() + +@app_group.command('enumerate-classes') +def enumerate_classes(): + from . import enumerate_classes + environment_name = 'production' + path_base = '/var/lib/machines/busting/etc/puppetlabs/code/environments/' + enumerate_classes.run( + path_base=path_base, + environment_name=environment_name) + +def init_app(app): + """Add command line options to current flask app.""" + app.cli.add_command(app_group) + |