Move Attract commands into attract subcommand
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import logging
|
||||
|
||||
from flask import current_app
|
||||
from flask_script import Manager
|
||||
|
||||
from pillar.cli import manager, create_service_account
|
||||
from pillar.api.utils import authentication
|
||||
@@ -11,10 +12,12 @@ import attract.setup
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
manager_attract = Manager(current_app, usage="Perform Attract operations")
|
||||
|
||||
@manager.command
|
||||
@manager.option('-r', '--replace', dest='replace', action='store_true', default=False)
|
||||
@manager.option('-s', '--svn', dest='svn_url', nargs='?')
|
||||
|
||||
@manager_attract.command
|
||||
@manager_attract.option('-r', '--replace', dest='replace', action='store_true', default=False)
|
||||
@manager_attract.option('-s', '--svn', dest='svn_url', nargs='?')
|
||||
def setup_for_attract(project_url, replace=False, svn_url=None):
|
||||
"""Adds Attract node types to the project.
|
||||
|
||||
@@ -26,7 +29,7 @@ def setup_for_attract(project_url, replace=False, svn_url=None):
|
||||
attract.setup.setup_for_attract(project_url, replace=replace, svn_url=svn_url)
|
||||
|
||||
|
||||
@manager.command
|
||||
@manager_attract.command
|
||||
def create_svner_account(email, project_url):
|
||||
"""Creates an account that can push SVN activity to an Attract project.
|
||||
|
||||
@@ -45,3 +48,5 @@ def create_svner_account(email, project_url):
|
||||
|
||||
account, token = create_service_account(email, [u'svner'], {'svner': {'project': proj['_id']}})
|
||||
return account, token
|
||||
|
||||
manager.add_command("attract", manager_attract)
|
||||
|
Reference in New Issue
Block a user