cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seb...@apache.org
Subject [29/50] [abbrv] cloudstack-gcestack git commit: Add debug flag to 'gstack'
Date Tue, 05 May 2015 11:19:03 GMT
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 <darrenbrogan@hotmail.com>
Authored: Tue Jun 24 18:24:21 2014 +0100
Committer: BroganD1993 <darrenbrogan@hotmail.com>
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',


Mime
View raw message