LGTM, thanks On Tue, 24 Mar 2015 at 14:39 'Klaus Aehlig' via ganeti-devel < [email protected]> wrote:
> > commit d15cc2a6801b75547fa6e2c866254a23c7bd37d5 > Merge: f89a387 51e9eef > Author: Klaus Aehlig <[email protected]> > Date: Tue Mar 24 14:37:53 2015 +0100 > > Merge branch 'stable-2.11' into stable-2.12 > > * stable-2.11 > Improve error handling when looking up instances > Capture last exception > > Signed-off-by: Klaus Aehlig <[email protected]> > > diff --cc lib/cmdlib/cluster.py > index 5401d84,6cb1401..7d75239 > --- a/lib/cmdlib/cluster.py > +++ b/lib/cmdlib/cluster.py > @@@ -138,13 -143,16 +139,14 @@@ class LUClusterRenewCrypto(NoHooksLU) > client_cert_tmp=pathutils.NODED_CLIENT_CERT_FILE_TMP) > break > except errors.OpExecError as e: > - pass > + last_exception = e > else: > - feedback_fn("Could not renew the master's client SSL certificate." > - " Cleaning up. Error: %s." % e) > + if last_exception: > + feedback_fn("Could not renew the master's client SSL > certificate." > + " Cleaning up. Error: %s." % last_exception) > # Cleaning up temporary certificates > - utils.RemoveNodeFromCandidateCerts("%s-SERVER" % master_uuid, > - cluster.candidate_certs) > - utils.RemoveNodeFromCandidateCerts("%s-OLDMASTER" % master_uuid, > - cluster.candidate_certs) > + self.cfg.RemoveNodeFromCandidateCerts("%s-SERVER" % master_uuid) > + self.cfg.RemoveNodeFromCandidateCerts("%s-OLDMASTER" % > master_uuid) > try: > utils.RemoveFile(pathutils.NODED_CLIENT_CERT_FILE_TMP) > except IOError: > @@@ -162,11 -171,12 +165,11 @@@ > try: > new_digest = CreateNewClientCert(self, node_uuid) > if node_info.master_candidate: > - utils.AddNodeToCandidateCerts(node_uuid, > - new_digest, > - cluster.candidate_certs) > + self.cfg.AddNodeToCandidateCerts(node_uuid, > + new_digest) > break > - except errors.OpExecError as last_exception: > - pass > + except errors.OpExecError as e: > + last_exception = e > else: > if last_exception: > node_errors[node_uuid] = last_exception > diff --cc lib/config.py > index 8e6c322,7729cda..af0e650 > --- a/lib/config.py > +++ b/lib/config.py > @@@ -2112,10 -1782,14 +2112,14 @@@ class ConfigWriter(object) > result = [] > for name in inst_names: > instance = self._UnlockedGetInstanceInfoByName(name) > - result.append((instance.uuid, instance)) > + if instance: > + result.append((instance.uuid, instance)) > + else: > + raise errors.ConfigurationError("Instance data of instance '%s'" > + " not found." % name) > return result > > - @locking.ssynchronized(_config_lock, shared=1) > + @_ConfigSync(shared=1) > def GetAllInstancesInfo(self): > """Get the configuration of all instances. > > > -- > Klaus Aehlig > Google Germany GmbH, Dienerstr. 12, 80331 Muenchen > Registergericht und -nummer: Hamburg, HRB 86891 > Sitz der Gesellschaft: Hamburg > Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores >
