summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Callaghan <dcallagh@redhat.com>2011-07-29 11:18:10 +1000
committerDan Callaghan <dcallagh@redhat.com>2011-07-29 13:28:03 +1000
commit710472aac27dafd03a3d6ff51f49a61646e15a9b (patch)
treec90cc6a5559641cc299f97cf0fb2b02cba8cca78
parentf97de425cdc398c1c5435b0f32c983071fff4e14 (diff)
fix cloning multiple child nodes in <hostRequires/> and <partitions/>
This also adds the <hypervisor/> element to beaker-job.rng. Bug: 655837 Change-Id: If1205dec5220f03f100f6fd17ecf6d56a02e2d71
-rw-r--r--Common/bkr/common/schema/beaker-job.rng1
-rw-r--r--IntegrationTests/src/bkr/inttest/complete-job.xml6
-rw-r--r--Server/bkr/server/model.py4
3 files changed, 8 insertions, 3 deletions
diff --git a/Common/bkr/common/schema/beaker-job.rng b/Common/bkr/common/schema/beaker-job.rng
index 877fc00..66b2533 100644
--- a/Common/bkr/common/schema/beaker-job.rng
+++ b/Common/bkr/common/schema/beaker-job.rng
@@ -278,6 +278,7 @@
<element name="hostname"><ref name="req"/></element>
<element name="arch"><ref name="req"/></element>
<element name="auto_prov"><ref name="req"/></element>
+ <element name="hypervisor"><ref name="req"/></element>
<element name="group">
<ref name="equality_op"/>
<attribute name="value"/>
diff --git a/IntegrationTests/src/bkr/inttest/complete-job.xml b/IntegrationTests/src/bkr/inttest/complete-job.xml
index 906580b..2184417 100644
--- a/IntegrationTests/src/bkr/inttest/complete-job.xml
+++ b/IntegrationTests/src/bkr/inttest/complete-job.xml
@@ -27,8 +27,12 @@
</distroRequires>
<hostRequires>
<system_type value="Machine"/>
+ <hypervisor op="=" value=""/>
</hostRequires>
- <partitions/>
+ <partitions>
+ <partition fs="btrfs" name="/mnt/testarea" size="18" type="part"/>
+ <partition fs="btrfs" name="/usr/local" size="8" type="part"/>
+ </partitions>
<task name="/distribution/install" role="STANDALONE">
<params/>
</task>
diff --git a/Server/bkr/server/model.py b/Server/bkr/server/model.py
index c6730b4..4ffb297 100644
--- a/Server/bkr/server/model.py
+++ b/Server/bkr/server/model.py
@@ -4824,13 +4824,13 @@ class Recipe(TaskBase):
recipe.appendChild(dr)
hostRequires = self.doc.createElement("hostRequires")
for hr in hrs.getElementsByTagName("hostRequires"):
- for child in hr.childNodes:
+ for child in hr.childNodes[:]:
hostRequires.appendChild(child)
recipe.appendChild(hostRequires)
prs = xml.dom.minidom.parseString(self.partitions)
partitions = self.doc.createElement("partitions")
for pr in prs.getElementsByTagName("partitions"):
- for child in pr.childNodes:
+ for child in pr.childNodes[:]:
partitions.appendChild(child)
recipe.appendChild(partitions)
for t in self.tasks: