Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 73C5210B4A for ; Tue, 5 May 2015 11:19:22 +0000 (UTC) Received: (qmail 32674 invoked by uid 500); 5 May 2015 11:18:37 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 32536 invoked by uid 500); 5 May 2015 11:18:37 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 30576 invoked by uid 99); 5 May 2015 11:18:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2015 11:18:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 03684E0AFD; Tue, 5 May 2015 11:18:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sebgoa@apache.org To: dev@cloudstack.apache.org Date: Tue, 05 May 2015 11:19:03 -0000 Message-Id: <884547539110402dad4ef9f1d63c6908@git.apache.org> In-Reply-To: <84733594f2e94cf2a2556c37dc71cb4a@git.apache.org> References: <84733594f2e94cf2a2556c37dc71cb4a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [29/50] [abbrv] cloudstack-gcestack git commit: Add debug flag to 'gstack' Add debug flag to 'gstack' Project: http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/commit/0441dd27 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/tree/0441dd27 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/diff/0441dd27 Branch: refs/heads/master Commit: 0441dd27eeb04b5b5de64cdb549f6a1672723031 Parents: 0875759 Author: BroganD1993 Authored: Tue Jun 24 18:24:21 2014 +0100 Committer: BroganD1993 Committed: Tue Jun 24 18:24:21 2014 +0100 ---------------------------------------------------------------------- gstack/__init__.py | 18 +++++++++++++++--- gstack/configure.py | 11 ++++++----- gstack/controllers/firewalls.py | 7 ------- setup.py | 3 ++- 4 files changed, 23 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/blob/0441dd27/gstack/__init__.py ---------------------------------------------------------------------- diff --git a/gstack/__init__.py b/gstack/__init__.py index 0624553..78dc81f 100644 --- a/gstack/__init__.py +++ b/gstack/__init__.py @@ -31,10 +31,19 @@ def _generate_args(): parser = argparse.ArgumentParser() parser.add_argument( - 'profile', + '-p', + '--profile', + required=False, help='The profile to run gstack with, default is initial', - default='initial', - nargs='?' + default='initial' + ) + + parser.add_argument( + '-d', + '--debug', + required=False, + help='Turn debug on for application', + default=False ) args = parser.parse_args() @@ -84,6 +93,9 @@ def configure_app(settings=None): else: args = _generate_args() profile = args.pop('profile') + ha = args.pop('debug') + print ha + app.config['DEBUG'] = ha config_file = _load_config_file() database_uri = _load_database() _config_from_config_profile(config_file, profile) http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/blob/0441dd27/gstack/configure.py ---------------------------------------------------------------------- diff --git a/gstack/configure.py b/gstack/configure.py index 242e901..da6e62b 100644 --- a/gstack/configure.py +++ b/gstack/configure.py @@ -27,8 +27,8 @@ from alembic.config import Config as AlembicConfig def main(): config_folder = _create_config_folder() - _create_database() _create_config_file(config_folder) + _create_database() def _create_config_folder(): @@ -54,10 +54,11 @@ def _generate_args(): ) parser.add_argument( - 'profile', - help='The profile to configure, default is initial', - default='initial', - nargs='?' + '-p', + '--profile', + required=False, + help='The profile to run gstack with, default is initial', + default='initial' ) args = parser.parse_args() http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/blob/0441dd27/gstack/controllers/firewalls.py ---------------------------------------------------------------------- diff --git a/gstack/controllers/firewalls.py b/gstack/controllers/firewalls.py index ddca6e4..80f96f7 100755 --- a/gstack/controllers/firewalls.py +++ b/gstack/controllers/firewalls.py @@ -95,13 +95,6 @@ def getsecuritygroup(projectid, authorization, firewall): ) cloudstack_response = cloudstack_response - app.logger.debug( - 'Processing request for get Firewall\n' - 'Project: ' + projectid + '\n' + - 'Firewall: ' + firewall + '\n' + - json.dumps(cloudstack_response, indent=4, separators=(',', ': ')) - ) - if cloudstack_response['listsecuritygroupsresponse']['securitygroup']: response_item = cloudstack_response[ 'listsecuritygroupsresponse']['securitygroup'][0] http://git-wip-us.apache.org/repos/asf/cloudstack-gcestack/blob/0441dd27/setup.py ---------------------------------------------------------------------- diff --git a/setup.py b/setup.py index 770e70d..cc6b299 100755 --- a/setup.py +++ b/setup.py @@ -45,7 +45,8 @@ setup( url='https://github.com/NOPping/gstack', platforms=('Any'), license='LICENSE.txt', - package_data={'': ['LICENSE.txt', 'data/*', 'migrations/*']}, + package_data={'': ['LICENSE.txt', 'data/*'], + 'migrations': ['versions/*', '*.mako']}, packages=[ 'gstack', 'gstack.controllers',