From cd1510785f94ee7b3b76570ead8b73ccac7f8dd0 Mon Sep 17 00:00:00 2001 From: Todd Willey Date: Wed, 14 Jul 2010 12:43:57 -0400 Subject: Fixes from code review. --- nova/adminclient.py | 7 +++---- nova/compute/model.py | 14 +++++--------- nova/compute/node.py | 3 +-- 3 files changed, 9 insertions(+), 15 deletions(-) (limited to 'nova') diff --git a/nova/adminclient.py b/nova/adminclient.py index 480e907c9..a97ad16a8 100644 --- a/nova/adminclient.py +++ b/nova/adminclient.py @@ -28,7 +28,8 @@ import boto from boto.ec2.regioninfo import RegionInfo class UserInfo(object): - """ Information about a Nova user + """ + Information about a Nova user, as parsed through SAX fields include: username accesskey @@ -46,11 +47,9 @@ class UserInfo(object): def __repr__(self): return 'UserInfo:%s' % self.username - # this is needed by the sax parser, so ignore the ugly name def startElement(self, name, attrs, connection): return None - # this is needed by the sax parser, so ignore the ugly name def endElement(self, name, value, connection): if name == 'username': self.username = str(value) @@ -63,7 +62,7 @@ class UserInfo(object): class HostInfo(object): """ - Information about a Nova Host: + Information about a Nova Host, as parsed through SAX: Disk stats Running Instances Memory stats diff --git a/nova/compute/model.py b/nova/compute/model.py index ad1f97a0a..88b94525c 100644 --- a/nova/compute/model.py +++ b/nova/compute/model.py @@ -366,9 +366,7 @@ class Instance(BasicModel): return super(Instance, self).destroy() class Host(BasicModel): - """ - A Host is the machine where a Daemon is running. - """ + """A Host is the machine where a Daemon is running.""" def __init__(self, hostname): """loads an instance from the datastore if exists""" @@ -385,9 +383,7 @@ class Host(BasicModel): class Daemon(BasicModel): - """ - A Daemon is a job (compute, api, network, ...) that runs on a host. - """ + """A Daemon is a job (compute, api, network, ...) that runs on a host.""" def __init__(self, host_or_combined, binpath=None): """loads an instance from the datastore if exists""" @@ -404,9 +400,9 @@ class Daemon(BasicModel): super(Daemon, self).__init__() def default_state(self): - return {"hostname": self.hostname, - "binary": self.binary, - "updated_at": utils.isotime() + return {"hostname": self.hostname, + "binary": self.binary, + "updated_at": utils.isotime() } @property diff --git a/nova/compute/node.py b/nova/compute/node.py index 7859d71c0..5b664f82d 100644 --- a/nova/compute/node.py +++ b/nova/compute/node.py @@ -144,8 +144,7 @@ class Node(object, service.Service): @defer.inlineCallbacks def report_state(self, nodename, daemon): - # TODO(termie): Termie has an idea for wrapping this connection failure - # pattern to be more elegant. -todd + # TODO(termie): make this pattern be more elegant. -todd try: record = model.Daemon(nodename, daemon) record.heartbeat() -- cgit