On Wed, Jan 15, 2014 at 10:23 AM, Petr Pudlak <[email protected]> wrote:
> This ensures that every node gets its ssconf copy as soon as possible.
>
> Signed-off-by: Petr Pudlak <[email protected]>
> ---
>  lib/config.py | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/lib/config.py b/lib/config.py
> index 3f5b56e..45cf7a7 100644
> --- a/lib/config.py
> +++ b/lib/config.py
> @@ -2515,6 +2515,7 @@ class ConfigWriter(object):
>      ssconf = self._UnlockedGetSsconfValues()
>      if ssconf != self._last_written_ssconf:
>        logging.debug("Ssconf changed, distributing")
> +      uploaderr = False

What does uploaderr stand for? Can we use a more descriptive name?

Thanks,

Guido


>        if not self._offline:
>          result = self._GetRpc(None).call_write_ssconf_files(
>            self._UnlockedGetNodeNames(self._UnlockedGetOnlineNodeList()),
> @@ -2523,6 +2524,7 @@ class ConfigWriter(object):
>          for nname, nresu in result.items():
>            msg = nresu.fail_msg
>            if msg:
> +            uploaderr = True
>              errmsg = ("Error while uploading ssconf files to"
>                        " node %s: %s" % (nname, msg))
>              logging.warning(errmsg)
> @@ -2530,7 +2532,12 @@ class ConfigWriter(object):
>              if feedback_fn:
>                feedback_fn(errmsg)
>
> -      self._last_written_ssconf = ssconf
> +      # If any of the upload operations failed, reset the marker so that we
> +      # try to upload everything again at the next write.
> +      if uploaderr:
> +        self._last_written_ssconf = {}
> +      else: # all OK
> +        self._last_written_ssconf = ssconf
>      else:
>        logging.debug("Ssconf unchanged")
>
> --
> 1.8.5.2
>



-- 
Guido Trotter
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