From 484ec68accd84d58e1a3ad1efd8f3631f78fb520 Mon Sep 17 00:00:00 2001 From: Craig Vyvial Date: Wed, 7 Mar 2012 21:53:59 -0600 Subject: [PATCH] fixing pep8 things --- etc/reddwarf/reddwarf.conf.sample | 2 +- reddwarf/common/config.py | 3 +++ reddwarf/common/exception.py | 1 - reddwarf/database/models.py | 8 +++++--- reddwarf/database/service.py | 7 ++++--- reddwarf/openstack/common/config.py | 2 ++ 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/etc/reddwarf/reddwarf.conf.sample b/etc/reddwarf/reddwarf.conf.sample index cd080627dd..cf54f8357a 100644 --- a/etc/reddwarf/reddwarf.conf.sample +++ b/etc/reddwarf/reddwarf.conf.sample @@ -44,7 +44,7 @@ reddwarf_proxy_admin_user = admin reddwarf_proxy_admin_pass = 3de4922d8b6ac5a1aad9 reddwarf_proxy_admin_tenant_name = admin reddwarf_auth_url = http://0.0.0.0:5000/v2.0 -reddwarf_tenant_id = 60fdac4a02aa4a8e87d772c61081b16a +reddwarf_tenant_id = configfile # ============ notifer queue kombu connection options ======================== diff --git a/reddwarf/common/config.py b/reddwarf/common/config.py index e7dd47b676..fa4e3552d9 100644 --- a/reddwarf/common/config.py +++ b/reddwarf/common/config.py @@ -44,6 +44,9 @@ class Config(object): @classmethod def get(cls, key, default=None): + print cls + print key + print default return cls.instance.get(key, default) @classmethod diff --git a/reddwarf/common/exception.py b/reddwarf/common/exception.py index 0a3ac08c8b..faea9d8305 100644 --- a/reddwarf/common/exception.py +++ b/reddwarf/common/exception.py @@ -47,4 +47,3 @@ class InvalidRPCConnectionReuse(ReddwarfError): class NotFound(ReddwarfError): message = _("Resource %(uuid)s cannot be found") - diff --git a/reddwarf/database/models.py b/reddwarf/database/models.py index 766640d301..f5eb722c7a 100644 --- a/reddwarf/database/models.py +++ b/reddwarf/database/models.py @@ -38,7 +38,8 @@ PROXY_ADMIN_TENANT_NAME = CONFIG.get('reddwarf_proxy_admin_tenant_name', 'admin') PROXY_AUTH_URL = CONFIG.get('reddwarf_auth_url', 'http://0.0.0.0:5000/v2.0') PROXY_TENANT_ID = CONFIG.get('reddwarf_tenant_id', - 'f5f71240a97c411e977452370422d7cc') + '60fdac4a02aa4a8e87d772c61081b16a') +print "PROXY_TENANT_ID : %s" % PROXY_TENANT_ID class ModelBase(object): @@ -135,10 +136,11 @@ class Instance(RemoteModelBase): except nova_exceptions.ClientException, e: raise rd_exceptions.ReddwarfError() - @classmethod def create(cls, proxy_token, name, image_id, flavor): - srv = cls.get_client(proxy_token).servers.create(name, image_id, flavor) + srv = cls.get_client(proxy_token).servers.create(name, + image_id, + flavor) return Instance(server=srv) diff --git a/reddwarf/database/service.py b/reddwarf/database/service.py index b68e763561..5143b03f83 100644 --- a/reddwarf/database/service.py +++ b/reddwarf/database/service.py @@ -54,15 +54,16 @@ class InstanceController(BaseController): def show(self, req, tenant_id, id): """Return a single instance.""" - server = models.Instance(proxy_token=req.headers["X-Auth-Token"], uuid=id).data() + server = models.Instance(proxy_token=req.headers["X-Auth-Token"], + uuid=id).data() #TODO(cp16net): need to set the return code correctly return wsgi.Result(views.InstanceView(server).data(), 201) def delete(self, req, tenant_id, id): """Delete a single instance.""" - models.Instance.delete(proxy_token=req.headers["X-Auth-Token"], uuid=id) - + models.Instance.delete(proxy_token=req.headers["X-Auth-Token"], + uuid=id) # TODO(hub-cap): fixgure out why the result is coming back as None LOG.info("result of delete %s" % result) diff --git a/reddwarf/openstack/common/config.py b/reddwarf/openstack/common/config.py index 7ae703e1ea..cc0ce268ef 100644 --- a/reddwarf/openstack/common/config.py +++ b/reddwarf/openstack/common/config.py @@ -317,6 +317,8 @@ def load_paste_app(app_name, options, args, config_dir=None): def get_option(options, option, **kwargs): + print __name__ + print options if option in options: value = options[option] type_ = kwargs.get('type', 'str')