]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-23218] fix UnboundLocalError when create mgr with bad hosts 470/head
authorint32bit <krystism@gmail.com>
Mon, 5 Mar 2018 15:02:17 +0000 (23:02 +0800)
committerint32bit <krystism@gmail.com>
Mon, 5 Mar 2018 15:02:17 +0000 (23:02 +0800)
ceph_deploy/mgr.py

index a44e576d2df7b1f8fc556cc4f2d739329a11ca8b..6d5ad13d52630a385f3da28bbc7d7c1809daf960 100644 (file)
@@ -139,6 +139,7 @@ def mgr_create(args):
 
     for hostname, name in args.mgr:
         try:
+            distro = None
             distro = hosts.get(hostname, username=args.username)
             rlogger = distro.conn.logger
             LOG.info(
@@ -170,7 +171,7 @@ def mgr_create(args):
             create_mgr(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)