]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
remove useless if dry run conditions 162/head
authorAlfredo Deza <alfredo.deza@inktank.com>
Wed, 5 Feb 2014 16:41:44 +0000 (11:41 -0500)
committerAlfredo Deza <alfredo.deza@inktank.com>
Wed, 5 Feb 2014 16:41:44 +0000 (11:41 -0500)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
ceph_deploy/new.py

index 9607c3f21bfd1d12a1d54196448ffe8d5e3ca454..0be8ceb82268d761e8e6add0028e26ef3dfedbe0 100644 (file)
@@ -144,30 +144,28 @@ def new(args):
         )
 
     LOG.debug('Writing initial config to %s...', path)
-    if not args.dry_run:
-        tmp = '%s.tmp' % path
-        with file(tmp, 'w') as f:
-            cfg.write(f)
-        try:
-            os.rename(tmp, path)
-        except OSError as e:
-            if e.errno == errno.EEXIST:
-                raise exc.ClusterExistsError(path)
-            else:
-                raise
+    tmp = '%s.tmp' % path
+    with file(tmp, 'w') as f:
+        cfg.write(f)
+    try:
+        os.rename(tmp, path)
+    except OSError as e:
+        if e.errno == errno.EEXIST:
+            raise exc.ClusterExistsError(path)
+        else:
+            raise
 
     LOG.debug('Writing monitor keyring to %s...', keypath)
-    if not args.dry_run:
-        tmp = '%s.tmp' % keypath
-        with file(tmp, 'w') as f:
-            f.write(mon_keyring)
-        try:
-            os.rename(tmp, keypath)
-        except OSError as e:
-            if e.errno == errno.EEXIST:
-                raise exc.ClusterExistsError(keypath)
-            else:
-                raise
+    tmp = '%s.tmp' % keypath
+    with file(tmp, 'w') as f:
+        f.write(mon_keyring)
+    try:
+        os.rename(tmp, keypath)
+    except OSError as e:
+        if e.errno == errno.EEXIST:
+            raise exc.ClusterExistsError(keypath)
+        else:
+            raise
 
 
 @priority(10)