From: int32bit Date: Mon, 5 Mar 2018 14:52:51 +0000 (+0800) Subject: [RM-23218] fix UnboundLocalError when create mds with bad hosts X-Git-Tag: v2.0.1~4^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e130a67cbfa1af15b00fa7ef0e13039956aa3d8a;p=ceph-deploy.git [RM-23218] fix UnboundLocalError when create mds with bad hosts --- diff --git a/ceph_deploy/mds.py b/ceph_deploy/mds.py index f4aabc7..58f3eb8 100644 --- a/ceph_deploy/mds.py +++ b/ceph_deploy/mds.py @@ -139,6 +139,7 @@ def mds_create(args): for hostname, name in args.mds: try: + distro = None distro = hosts.get(hostname, username=args.username) rlogger = distro.conn.logger LOG.info( @@ -170,7 +171,7 @@ def mds_create(args): create_mds(distro, name, args.cluster, distro.init) distro.conn.exit() except RuntimeError as e: - if distro.normalized_name == 'redhat': + if distro and distro.normalized_name == 'redhat': LOG.error('this feature may not yet available for %s %s' % (distro.name, distro.release)) failed_on_rhel = True LOG.error(e)