summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorTodd Willey <todd@rubidine.com>2010-07-14 23:34:10 -0400
committerTodd Willey <todd@rubidine.com>2010-07-14 23:34:10 -0400
commitb0b2d607b4f2db8ffbb5d091c4a3cd33ea6ed672 (patch)
treeb8d015efcdd8ae6d2afbfef6627527e636fe36ce /nova/compute
parent975f6f75111102d85c45a4e57f30255ececc9133 (diff)
Cleanups related to BasicModel (whitespace, names, etc).
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/model.py3
-rw-r--r--nova/compute/network.py7
2 files changed, 7 insertions, 3 deletions
diff --git a/nova/compute/model.py b/nova/compute/model.py
index 5d4b0879e..cc5f74b3d 100644
--- a/nova/compute/model.py
+++ b/nova/compute/model.py
@@ -225,8 +225,7 @@ class Daemon(datastore.BasicModel):
def heartbeat(self):
self['updated_at'] = utils.isotime()
- self.save()
- return True
+ return self.save()
@classmethod
def by_host(cls, hostname):
diff --git a/nova/compute/network.py b/nova/compute/network.py
index 15635d707..b2458828e 100644
--- a/nova/compute/network.py
+++ b/nova/compute/network.py
@@ -119,7 +119,7 @@ class Vlan(datastore.BasicModel):
def save(self):
"""
Vlan saves state into a giant hash named "vlans", with keys of
- proejct_id and value of valn number. Therefore, we skip the
+ project_id and value of vlan number. Therefore, we skip the
default way of saving into "vlan:ID" and adding to a set of "vlans".
"""
set_name = self._redis_set_name(self.__class__.__name__)
@@ -134,6 +134,7 @@ class Vlan(datastore.BasicModel):
vlan = int(self.vlan_id)
network = IPy.IP(FLAGS.private_range)
start = (vlan-FLAGS.vlan_start) * FLAGS.network_size
+ # minus one for the gateway.
return "%s-%s" % (network[start],
network[start + FLAGS.network_size - 1])
@@ -504,6 +505,10 @@ def get_vlan_for_project(project_id):
# sexier if it didn't fight against the way
# BasicModel worked and used associate_with
# to build connections to projects.
+ # NOTE(josh): This is here because we want to make sure we
+ # don't orphan any VLANs. It is basically
+ # garbage collection for after projects abandoned
+ # their reference.
vlan.project_id = project_id
vlan.save()
return vlan