[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH] Supplemental packs: reflect homogeneity in package strings in Host.software_version


  • To: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
  • From: Rob Hoes <rob.hoes@xxxxxxxxxx>
  • Date: Fri, 6 Nov 2009 17:41:44 +0000
  • Delivery-date: Fri, 06 Nov 2009 09:41:48 -0800
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
Supplemental packs: reflect homogeneity in package strings in 
Host.software_version

If the XML file containing the description of a supplemental pack has the 
enforce-homogeneity attribute present and set to "true", append ", homogeneous" 
to the pack's string in Host.software_version.

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r 212155f4ac57 ocaml/xapi/create_misc.ml
--- a/ocaml/xapi/create_misc.ml Thu Nov 05 11:40:52 2009 +0000
+++ b/ocaml/xapi/create_misc.ml Fri Nov 06 17:24:35 2009 +0000
@@ -308,8 +308,14 @@
   Printf.sprintf "%d.%d" Xapi_globs.version_major Xapi_globs.version_minor  
   
 (** Create assoc list of Supplemental-Pack information.
+ *  The package information is taking from the [XS-REPOSITORY] XML file in the 
package
+ *  directory.
+ *  The keys have the form "<originator>:<name>", the value is
+ *  "<description>, version <version>", appended by ", build <build>" if the 
<build>
+ *  number is present in the XML file, and appended by ", homogeneous" if the 
[enforce-homogeneity]
+ *  attribute is present and set to "true".
  *  For backwards compatibility, the old [package-linux] key is also added
- *  when the linux pack (now xs:linux) is present (alongside the new key).
+ *  when the linux pack (now [xs:linux]) is present (alongside the new key).
  *  The [package-linux] key is now deprecated and will be removed in the next 
version. *)
 let make_packs_info () =
        try
@@ -326,15 +332,22 @@
                                                if List.mem_assoc "build" attr 
then Some (List.assoc "build" attr)
                                                else None
                                        in
+                                       let homogeneous = 
+                                               if List.mem_assoc 
"enforce-homogeneity" attr &&
+                                                       (List.assoc 
"enforce-homogeneity" attr) = "true" then true
+                                               else false
+                                       in
                                        let description = match children with
                                                | Xml.Element(_, _, (Xml.PCData 
s) :: _) :: _ -> s
                                                | _ -> failwith "error with 
parsing pack data"
                                        in
                                        let param_name = originator ^ ":" ^ 
name in
                                        let value = description ^ ", version " 
^ version ^
-                                               match build with
+                                               (match build with
                                                | Some build -> ", build " ^ 
build
-                                               | None -> ""
+                                               | None -> "") ^
+                                               (if homogeneous then ", 
homogeneous"
+                                               else "")
                                        in
                                        let kv = [(param_name, value)] in
                                        if originator = "xs" && name = "linux" 
then

Attachment: packs-homogeneity
Description: Text document

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.