summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Styk <mastyk@redhat.com>2019-08-06 20:55:33 +0200
committerMartin Styk <mastyk@redhat.com>2019-08-06 20:55:47 +0200
commite696e4a5c5e16742e70db54323b8f17caa8b4ded (patch)
tree75260c1476b3a5a70c824bd167a9b82ac436f191
parent39cc819ab553ab61a182576ee6ec7fea59064a8b (diff)
Fix filter for OpenStack flavors
The condition should be greater or equal to 10G. Instead of greater. Change-Id: I923414129194dd1424f3f4c8bce1523a7146f012 Signed-off-by: Martin Styk <mastyk@redhat.com>
-rw-r--r--IntegrationTests/src/bkr/inttest/server/test_beakerd.py5
-rw-r--r--Server/bkr/server/needpropertyxml.py2
2 files changed, 4 insertions, 3 deletions
diff --git a/IntegrationTests/src/bkr/inttest/server/test_beakerd.py b/IntegrationTests/src/bkr/inttest/server/test_beakerd.py
index 799ec6e..b90c755 100644
--- a/IntegrationTests/src/bkr/inttest/server/test_beakerd.py
+++ b/IntegrationTests/src/bkr/inttest/server/test_beakerd.py
@@ -2029,9 +2029,10 @@ class TestProvisionVirtRecipes(DatabaseTestCase):
instance = self.virt_manager.novaclient.servers.get(
recipe.resource.instance_id)
available_flavors = self.virt_manager.available_flavors()
- # remove the flavor that has no disk.
+ # remove the flavor that has no disk
+ # and flavor with really small disk
for flavor in available_flavors:
- if flavor.disk == 0:
+ if flavor.disk < 10:
available_flavors.remove(flavor)
# cheapest flavor is smallest disk and smallest ram
smallest_disk_list = sorted(available_flavors, key=lambda flavor: flavor.disk)
diff --git a/Server/bkr/server/needpropertyxml.py b/Server/bkr/server/needpropertyxml.py
index eb7af6e..3df1914 100644
--- a/Server/bkr/server/needpropertyxml.py
+++ b/Server/bkr/server/needpropertyxml.py
@@ -1334,7 +1334,7 @@ class XmlHost(XmlAnd):
def filter_openstack_flavors(self, flavors, lab_controller):
result = super(XmlHost, self).filter_openstack_flavors(flavors, lab_controller)
# 10G is sufficient for most of current distributions supported by Beaker
- return [flavor for flavor in result if flavor.disk > 10]
+ return [flavor for flavor in result if flavor.disk >= 10]
class XmlDistro(XmlAnd):