Interdiff:

diff --git a/lib/cmdlib/instance.py b/lib/cmdlib/instance.py
index f2fb187..22175b0 100644
--- a/lib/cmdlib/instance.py
+++ b/lib/cmdlib/instance.py
@@ -1509,6 +1509,24 @@ class LUInstanceCreate(LogicalUnit):
                       (self.op.instance_name, self.pnode.name), 
self.LogWarning)
 
   def UpdateInstanceOsInstallPackage(self, feedback_fn, instance):
+    """Updates the OS parameter 'os-install-package' for an instance.
+
+    The OS install package is an archive containing an OS definition
+    and a file containing the environment variables needed to run the
+    scripts.
+
+    The OS install package is served by the metadata daemon to the
+    instances, so the OS scripts can run inside the virtualized
+    environment.
+
+    @type feedback_fn: callable
+    @param feedback_fn: function used send feedback back to the caller
+
+    @type instance: L{objects.Instance}
+    @param instance: instance for which the OS parameter
+                     'os-install-package' is updated
+
+    """
     if "os-install-package" in instance.osparams:
       feedback_fn("Using OS install package '%s'" %
                   instance.osparams["os-install-package"])

On May 13 19:42, Hrvoje Ribicic wrote:
> On Tue, May 13, 2014 at 7:39 PM, Hrvoje Ribicic <[email protected]> wrote:
> 
> > On Tue, May 13, 2014 at 10:43 AM, 'Jose A. Lopes' via ganeti-devel <
> > [email protected]> wrote:
> >
> >> This helper method either picks up the package passed through the OS
> >> parameters or creates a new package and updates the instance's OS
> >> parameters.  This allows users to add their own OS install package.
> >>
> >> Signed-off-by: Jose A. Lopes <[email protected]>
> >> ---
> >>  lib/cmdlib/instance.py | 11 +++++++++++
> >>  1 file changed, 11 insertions(+)
> >>
> >> diff --git a/lib/cmdlib/instance.py b/lib/cmdlib/instance.py
> >> index d730175..f2fb187 100644
> >> --- a/lib/cmdlib/instance.py
> >> +++ b/lib/cmdlib/instance.py
> >> @@ -1508,6 +1508,17 @@ class LUInstanceCreate(LogicalUnit):
> >>            result.Warn("Failed to run rename script for %s on node %s" %
> >>                        (self.op.instance_name, self.pnode.name),
> >> self.LogWarning)
> >>
> >> +  def UpdateInstanceOsInstallPackage(self, feedback_fn, instance):
> >>
> >
> > Missing docstring ;)
> >
> >
> >> +    if "os-install-package" in instance.osparams:
> >> +      feedback_fn("Using OS install package '%s'" %
> >> +                  instance.osparams["os-install-package"])
> >> +    else:
> >> +      result = self.rpc.call_os_export(instance.primary_node, instance)
> >> +      result.Raise("Could not export OS '%s'" % instance.os)
> >> +      instance.osparams["os-install-package"] = result.payload
> >> +
> >> +      feedback_fn("Created OS install package '%s'" % result.payload)
> >> +
> >>    def Exec(self, feedback_fn):
> >>      """Create and add the instance to the cluster.
> >>
> >> --
> >> 1.9.1.423.g4596e3a
> >>
> >>
> > My comment for patch 17 may require some changes here - please look at
> > that one first.
> >
> 
> Actually, scratch that, just the docstring here :)

-- 
Jose Antonio Lopes
Ganeti Engineering
Google Germany GmbH
Dienerstr. 12, 80331, München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores
Steuernummer: 48/725/00206
Umsatzsteueridentifikationsnummer: DE813741370

Reply via email to