diff options
Diffstat (limited to 'pyenc/enc.py')
-rw-r--r-- | pyenc/enc.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/pyenc/enc.py b/pyenc/enc.py index 24f9fdc..e0f3f8d 100644 --- a/pyenc/enc.py +++ b/pyenc/enc.py @@ -1,15 +1,22 @@ +""" +Command line entry point for Puppet External Node Classifier (enc). +""" + import click -from flask import current_app, g -from flask.cli import with_appcontext -from .db import db +import yaml +# from flask import current_app, g +# from flask.cli import with_appcontext, AppGroup +from flask.cli import AppGroup +# from .db import db from . import model -import yaml -@click.command('enc') -@click.option('--fqdn', help='Node to get data for') -@with_appcontext +app_group = AppGroup('user', help="Testt") + +@app_group.command('enc') +@click.argument('fqdn') +# @with_appcontext def run_enc(fqdn): """ Run the puppet node classifier. @@ -25,8 +32,9 @@ def run_enc(fqdn): 'classes': [cls.class_name for cls in host.classes], } print(yaml.dump(out)) + return 0 def init_app(app): """Add puppet enc click to current flask app.""" - app.cli.add_command(run_enc) + app.cli.add_command(app_group) |