On Tue, May 05, 2009 at 10:46:43AM +0200, Guido Trotter wrote:
> 
> Sometimes reinstalls are slightly different than new installs. For
> example certain partitions may need to be preserved accross reinstalls.
> In order to do that on a per-os basis we pass in the INSTANCE_REINSTALL
> variable to inform the create script about when a reinstall is
> happening.
> 
> Signed-off-by: Guido Trotter <[email protected]>

The idea is good, two points:

> @@ -693,6 +695,8 @@ def InstanceOsAdd(instance):
>                (os_name, os_dir, os_err))
>  
>    create_env = OSEnvironment(instance)
> +  if reinstall:
> +    create_env['INSTANCE_REINSTALL'] = "1"

Why not move this into the OSEnvironment proper?

> diff --git a/lib/rpc.py b/lib/rpc.py
> index 70dd312..0f1d44d 100644
> --- a/lib/rpc.py
> +++ b/lib/rpc.py
> @@ -524,14 +524,14 @@ class RpcRunner(object):
>      return self._SingleNodeCall(node, "instance_reboot",
>                                  [self._InstDict(instance), reboot_type])
>  
> -  def call_instance_os_add(self, node, inst):
> +  def call_instance_os_add(self, node, inst, reinstall=False):
>      """Installs an OS on the given instance.

RPC calls with default arguments are not good; they will make very hard
to debug some cases, and if you need to change the function signature it
will be harder.

Can you please actually change all the calls to this RPC?

iustin

Reply via email to