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: I97a9b1b727053349e3f24c65ffabd69316af1c51
Signed-off-by: Ori Liel <[email protected]>
---
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/61/24261/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 1a25010..a81bdbc 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
@@ -2522,7 +2522,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"/>
@@ -3147,9 +3147,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>
@@ -3162,10 +3162,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/24261
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I97a9b1b727053349e3f24c65ffabd69316af1c51
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ori Liel <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to