From e1c555c7cfb62e9047c1ebd43c77f0186c0754e3 Mon Sep 17 00:00:00 2001 From: liyingjun Date: Thu, 5 Jun 2014 12:05:26 +0800 Subject: [PATCH] Rename api directory to rest Change-Id: I91773fda0f937e4f1c1f01a7545f77e9f64993c0 --- etc/rally/rally.conf.sample | 55 ++++++++++++++----- rally/{api/controllers => aas}/__init__.py | 0 rally/{api => aas/rest}/__init__.py | 12 ++-- rally/{api => aas/rest}/app.py | 4 +- rally/aas/rest/controllers/__init__.py | 0 rally/{api => aas/rest}/controllers/root.py | 4 +- .../rest}/controllers/v1/__init__.py | 2 +- .../{api => aas/rest}/controllers/v1/root.py | 2 +- rally/{api => aas/rest}/types.py | 0 rally/cmd/api.py | 6 +- 10 files changed, 55 insertions(+), 30 deletions(-) rename rally/{api/controllers => aas}/__init__.py (100%) rename rally/{api => aas/rest}/__init__.py (77%) rename rally/{api => aas/rest}/app.py (91%) create mode 100644 rally/aas/rest/controllers/__init__.py rename rally/{api => aas/rest}/controllers/root.py (94%) rename rally/{api => aas/rest}/controllers/v1/__init__.py (90%) rename rally/{api => aas/rest}/controllers/v1/root.py (97%) rename rally/{api => aas/rest}/types.py (100%) diff --git a/etc/rally/rally.conf.sample b/etc/rally/rally.conf.sample index 0b60310d12..f2a4d6cfdc 100644 --- a/etc/rally/rally.conf.sample +++ b/etc/rally/rally.conf.sample @@ -123,19 +123,6 @@ # Path to CA server cetrificate for SSL #https_cacert= -[api] - -# -# Options defined in rally.api -# - -# The port for the Rally API server (integer value) -#port=8877 - -# The listen IP for the Rally API server (string value) -#host=0.0.0.0 - - [benchmark] # @@ -188,6 +175,31 @@ #glance_image_delete_poll_interval=1.0 +# +# Options defined in rally.benchmark.scenarios.heat.utils +# + +# Time to sleep after creating a resource before polling for +# it status (floating point value) +#heat_stack_create_prepoll_delay=2.0 + +# Time to wait for heat stack to be created. (floating point +# value) +#heat_stack_create_timeout=3600.0 + +# Interval between checks when waiting for stack creation. +# (floating point value) +#heat_stack_create_poll_interval=1.0 + +# Time to wait for heat stack to be deleted. (floating point +# value) +#heat_stack_delete_timeout=3600.0 + +# Interval between checks when waiting for stack deletion. +# (floating point value) +#heat_stack_delete_poll_interval=1.0 + + # # Options defined in rally.benchmark.scenarios.nova.utils # @@ -401,13 +413,26 @@ # Options defined in rally.verification.verifiers.tempest.config # -# Version of cirros image +# Version of cirros image (string value) #cirros_version=0.3.2 -# Cirros image name +# Cirros image name (string value) #cirros_image=cirros-0.3.2-x86_64-disk.img +[rest] + +# +# Options defined in rally.aas.rest +# + +# The port for the Rally API server (integer value) +#port=8877 + +# The listen IP for the Rally API server (string value) +#host=0.0.0.0 + + [users_context] # diff --git a/rally/api/controllers/__init__.py b/rally/aas/__init__.py similarity index 100% rename from rally/api/controllers/__init__.py rename to rally/aas/__init__.py diff --git a/rally/api/__init__.py b/rally/aas/rest/__init__.py similarity index 77% rename from rally/api/__init__.py rename to rally/aas/rest/__init__.py index 6de8a45b2f..c1e0aba346 100644 --- a/rally/api/__init__.py +++ b/rally/aas/rest/__init__.py @@ -16,7 +16,7 @@ from oslo.config import cfg -API_SERVICE_OPTS = [ +REST_SERVICE_OPTS = [ cfg.IntOpt('port', default=8877, help='The port for the Rally API server', @@ -26,10 +26,10 @@ API_SERVICE_OPTS = [ help='The listen IP for the Rally API server', ), ] -API_OPT_GROUP = cfg.OptGroup(name='api', - title='Options for the openstack-rally-api ' - 'service') +REST_OPT_GROUP = cfg.OptGroup(name='rest', + title='Options for the openstack-rally-api ' + 'service') CONF = cfg.CONF -CONF.register_group(API_OPT_GROUP) -CONF.register_opts(API_SERVICE_OPTS, API_OPT_GROUP) +CONF.register_group(REST_OPT_GROUP) +CONF.register_opts(REST_SERVICE_OPTS, REST_OPT_GROUP) diff --git a/rally/api/app.py b/rally/aas/rest/app.py similarity index 91% rename from rally/api/app.py rename to rally/aas/rest/app.py index d601312107..97705b20be 100644 --- a/rally/api/app.py +++ b/rally/aas/rest/app.py @@ -36,8 +36,8 @@ def setup_app(config): def make_app(): config = { 'app': { - 'root': 'rally.api.controllers.root.RootController', - 'modules': ['rally.api'], + 'root': 'rally.aas.rest.controllers.root.RootController', + 'modules': ['rally.aas.rest'], 'debug': CONF.debug, }, 'wsme': { diff --git a/rally/aas/rest/controllers/__init__.py b/rally/aas/rest/controllers/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/rally/api/controllers/root.py b/rally/aas/rest/controllers/root.py similarity index 94% rename from rally/api/controllers/root.py rename to rally/aas/rest/controllers/root.py index 1ca05befe3..ff8813dc53 100644 --- a/rally/api/controllers/root.py +++ b/rally/aas/rest/controllers/root.py @@ -17,8 +17,8 @@ from pecan import rest from wsme import types as wtypes import wsmeext.pecan as wsme_pecan -from rally.api.controllers import v1 -from rally.api import types +from rally.aas.rest.controllers import v1 +from rally.aas.rest import types class Root(wtypes.Base): diff --git a/rally/api/controllers/v1/__init__.py b/rally/aas/rest/controllers/v1/__init__.py similarity index 90% rename from rally/api/controllers/v1/__init__.py rename to rally/aas/rest/controllers/v1/__init__.py index 4f892effc6..1dedae1938 100644 --- a/rally/api/controllers/v1/__init__.py +++ b/rally/aas/rest/controllers/v1/__init__.py @@ -13,4 +13,4 @@ # License for the specific language governing permissions and limitations # under the License. -from rally.api.controllers.v1.root import Controller # noqa +from rally.aas.rest.controllers.v1.root import Controller # noqa diff --git a/rally/api/controllers/v1/root.py b/rally/aas/rest/controllers/v1/root.py similarity index 97% rename from rally/api/controllers/v1/root.py rename to rally/aas/rest/controllers/v1/root.py index d21ee62637..dd8a633a66 100644 --- a/rally/api/controllers/v1/root.py +++ b/rally/aas/rest/controllers/v1/root.py @@ -16,7 +16,7 @@ from pecan import rest import wsmeext.pecan as wsme_pecan -from rally.api import types +from rally.aas.rest import types class Version(types.Version): diff --git a/rally/api/types.py b/rally/aas/rest/types.py similarity index 100% rename from rally/api/types.py rename to rally/aas/rest/types.py diff --git a/rally/cmd/api.py b/rally/cmd/api.py index 455303f7b2..e96c6d5840 100644 --- a/rally/cmd/api.py +++ b/rally/cmd/api.py @@ -22,7 +22,7 @@ from wsgiref import simple_server from oslo.config import cfg -from rally.api import app as rally_app +from rally.aas.rest import app as rally_app from rally.openstack.common.gettextutils import _ # noqa from rally.openstack.common import log @@ -36,8 +36,8 @@ def main(): CONF(sys.argv[1:], project='rally') log.setup('rally') # Prepare application and bind to the service socket. - host = CONF.api.host - port = CONF.api.port + host = CONF.rest.host + port = CONF.rest.port app = rally_app.make_app() server = simple_server.make_server(host, port, app) # Start application.