From 5059b4cac4b4ad554e9eb800c166062688988268 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Wed, 5 Feb 2014 11:41:44 -0500 Subject: [PATCH] remove useless if dry run conditions Signed-off-by: Alfredo Deza --- ceph_deploy/new.py | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/ceph_deploy/new.py b/ceph_deploy/new.py index 9607c3f..0be8ceb 100644 --- a/ceph_deploy/new.py +++ b/ceph_deploy/new.py @@ -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) -- 2.47.3