diff options
Diffstat (limited to 'pyenc/enc.py')
-rw-r--r-- | pyenc/enc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pyenc/enc.py b/pyenc/enc.py index 7ec3a8e..5df6ecb 100644 --- a/pyenc/enc.py +++ b/pyenc/enc.py @@ -1,4 +1,3 @@ - import click from flask import current_app, g from flask.cli import with_appcontext @@ -7,11 +6,12 @@ from . import model import yaml + @click.command('enc') @click.option('--fqdn', help='Node to get data for') @with_appcontext def run_enc(fqdn): - host = model.Host.query.where(model.Host.fqdn==fqdn).first() + host = model.Host.query.where(model.Host.fqdn == fqdn).first() if not host: print(f"No host with name {fqdn}") return 1 @@ -21,5 +21,6 @@ def run_enc(fqdn): } print(yaml.dump(out)) + def init_app(app): app.cli.add_command(run_enc) |