summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2011-08-16 13:36:11 -0500
committerJosh Kearney <josh@jk0.org>2011-08-16 13:36:11 -0500
commit935c43b414c1685163957590a6fb77fd8ddbac2f (patch)
tree82df394598074eee026945a954e0baa326ffde16
parent3df69958daa57f267cbce84e29d48bf69d79c509 (diff)
Allow local_gb to be 0; PEP8 fixes.
-rw-r--r--nova/compute/manager.py10
-rw-r--r--nova/virt/libvirt/connection.py5
2 files changed, 12 insertions, 3 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 3299268f2..39f43a268 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -359,6 +359,13 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_type = self.db.instance_type_get(context,
instance_type_id)
allowed_size_gb = instance_type['local_gb']
+
+ if allowed_size_gb == 0:
+ # NOTE(jk0): Since the default local_gb of m1.tiny is 0, we will
+ # allow the check to proceed. We may want to look into changing the
+ # default size to 1GB.
+ return
+
allowed_size_bytes = allowed_size_gb * 1024 * 1024 * 1024
LOG.debug(_("image_id=%(image_id)d, image_size_bytes="
@@ -1368,7 +1375,8 @@ class ComputeManager(manager.SchedulerDependentManager):
# This nwfilter is necessary on the destination host.
# In addition, this method is creating filtering rule
# onto destination host.
- self.driver.ensure_filtering_rules_for_instance(instance_ref, network_info)
+ self.driver.ensure_filtering_rules_for_instance(instance_ref,
+ network_info)
# Preparation for block migration
if block_migration:
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py
index 2b17e244a..e8a657bac 100644
--- a/nova/virt/libvirt/connection.py
+++ b/nova/virt/libvirt/connection.py
@@ -1538,8 +1538,9 @@ class LibvirtConnection(driver.ComputeDriver):
# If any instances never launch at destination host,
# basic-filtering must be set here.
self.firewall_driver.setup_basic_filtering(instance_ref, network_info)
- # setting up n)ova-instance-instance-xx mainly.
- self.firewall_driver.prepare_instance_filter(instance_ref, network_info)
+ # setting up nova-instance-instance-xx mainly.
+ self.firewall_driver.prepare_instance_filter(instance_ref,
+ network_info)
# wait for completion
timeout_count = range(FLAGS.live_migration_retry_count)