fixing pep8 things

This commit is contained in:
Craig Vyvial 2012-03-07 21:53:59 -06:00
parent acbbdf1027
commit 484ec68acc
6 changed files with 15 additions and 8 deletions

View File

@ -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 ========================

View File

@ -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

View File

@ -47,4 +47,3 @@ class InvalidRPCConnectionReuse(ReddwarfError):
class NotFound(ReddwarfError):
message = _("Resource %(uuid)s cannot be found")

View File

@ -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)

View File

@ -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)

View File

@ -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')