Ori Liel has uploaded a new change for review.

Change subject: restapi: Duplicate name 'nics' in schema
......................................................................

restapi: Duplicate name 'nics' in schema

QA tools assumes unique element names in the schema (api.xsd),
so naming inner element 'nics', which outer element by this name
already exists in the schema causes failure. Again, the failure
is in the QA tool, and is not a real code or business faliure.
Nevertheless, it's enough of a reason to change the element's name.

Bug-Url: http://bugzilla.redhat.com/1063187
Change-Id: Ibe88dc0fd9129776bf462921b42849ba99e12644
Signed-off-by: Ori Liel <ol...@redhat.com>
---
M 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
M 
backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
3 files changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/68/24268/1

diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
index e714850..f67230d 100644
--- 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
+++ 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
@@ -2521,7 +2521,7 @@
         <xs:element name="regenerate_ssh_keys" type="xs:boolean" minOccurs="0" 
maxOccurs="1"/>
         <xs:element name="dns_servers" type="xs:string" minOccurs="0" 
maxOccurs="1"/>
         <xs:element name="dns_search" type="xs:string" minOccurs="0" 
maxOccurs="1"/>
-        <xs:element name="nics" type="GuestNicsConfiguration" minOccurs="0" 
maxOccurs="1"/>
+        <xs:element ref="nic_configurations" minOccurs="0" maxOccurs="1"/>
         <xs:element name="windows_license_key" type="xs:string" minOccurs="0" 
maxOccurs="1"/>
         <xs:element name="root_password" type="xs:string" minOccurs="0" 
maxOccurs="1"/>
         <xs:element name="custom_script" type="xs:string" minOccurs="0" 
maxOccurs="1"/>
@@ -3146,9 +3146,9 @@
     </xs:complexContent>
   </xs:complexType>
 
-  <xs:element name="guest_nic_configuration" type="GuestNicConfiguration"/>
+  <xs:element name="nic_configuration" type="GuestNicConfiguration"/>
 
-  <xs:element name="guest_nics_configuation" type="GuestNicsConfiguration"/>
+  <xs:element name="nic_configurations" type="GuestNicsConfiguration"/>
 
   <xs:complexType name="GuestNicConfiguration">
     <xs:sequence>
@@ -3161,10 +3161,10 @@
 
   <xs:complexType name="GuestNicsConfiguration">
     <xs:sequence>
-      <xs:element name="nic" type="GuestNicConfiguration" minOccurs="0" 
maxOccurs="unbounded">
+      <xs:element ref="nic_configuration" minOccurs="0" maxOccurs="unbounded">
         <xs:annotation>
           <xs:appinfo>
-            <jaxb:property name="Nics"/>
+            <jaxb:property name="NicConfigurations"/>
           </xs:appinfo>
         </xs:annotation>
       </xs:element>
diff --git 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
index f6127fb..4842fa0 100644
--- 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
+++ 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
@@ -993,9 +993,9 @@
             entity.setCustomScript(model.getCustomScript());
         }
 
-        if (model.isSetNics()) {
+        if (model.isSetNicConfigurations()) {
             List<VmInitNetwork> networks = new ArrayList<VmInitNetwork>();
-            for(GuestNicConfiguration nic: model.getNics().getNics()) {
+            for (GuestNicConfiguration nic : 
model.getNicConfigurations().getNicConfigurations()) {
                 networks.add(map(nic, null));
             }
             entity.setNetworks(networks);
@@ -1039,9 +1039,9 @@
             model.setCustomScript(entity.getCustomScript());
         }
         if (entity.getNetworks() != null) {
-            model.setNics(new GuestNicsConfiguration());
+            model.setNicConfigurations(new GuestNicsConfiguration());
             for (VmInitNetwork network : entity.getNetworks()) {
-                model.getNics().getNics().add(map(network, null));
+                
model.getNicConfigurations().getNicConfigurations().add(map(network, null));
             }
         }
         return model;
diff --git 
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
 
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
index 229e994..b3ac68c 100644
--- 
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
+++ 
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/VmMapperTest.java
@@ -91,7 +91,7 @@
         from.setPlacementPolicy(new VmPlacementPolicy());
         from.getPlacementPolicy().setHost(new Host());
         from.getPlacementPolicy().getHost().setId(Guid.Empty.toString());
-        for (GuestNicConfiguration guestNic: 
from.getInitialization().getNics().getNics()) {
+        for (GuestNicConfiguration guestNic : 
from.getInitialization().getNicConfigurations().getNicConfigurations()) {
             
guestNic.setBootProtocol(MappingTestHelper.shuffle(BootProtocol.class).value());
         }
         return from;


-- 
To view, visit http://gerrit.ovirt.org/24268
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe88dc0fd9129776bf462921b42849ba99e12644
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.4
Gerrit-Owner: Ori Liel <ol...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to