summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/ipa_backup.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-07-15 16:38:06 +0200
committerJan Cholasta <jcholast@redhat.com>2015-07-31 15:22:19 +0200
commitb8c46f2a32d0d8c2dc6ef0867f85f63cf076a004 (patch)
tree28e52d8fe2e3531e226d8c2249d6b7216f80bf48 /ipaserver/install/ipa_backup.py
parenta908be2785d4388e3c97c7cd543c817c527d73c9 (diff)
downloadfreeipa-b8c46f2a32d0d8c2dc6ef0867f85f63cf076a004.tar.gz
freeipa-b8c46f2a32d0d8c2dc6ef0867f85f63cf076a004.tar.xz
freeipa-b8c46f2a32d0d8c2dc6ef0867f85f63cf076a004.zip
Modernize number literals
Use Python-3 compatible syntax, without breaking compatibility with py 2.7 - Octals literals start with 0o to prevent confusion - The "L" at the end of large int literals is not required as they use long on Python 2 automatically. - Using 'int' instead of 'long' for small numbers is OK in all cases except strict type checking checking, e.g. type(0). https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/install/ipa_backup.py')
-rw-r--r--ipaserver/install/ipa_backup.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipaserver/install/ipa_backup.py b/ipaserver/install/ipa_backup.py
index f7e032ae5..685c618d8 100644
--- a/ipaserver/install/ipa_backup.py
+++ b/ipaserver/install/ipa_backup.py
@@ -263,9 +263,9 @@ class Backup(admintool.AdminTool):
self.top_dir = tempfile.mkdtemp("ipa")
os.chown(self.top_dir, pent.pw_uid, pent.pw_gid)
- os.chmod(self.top_dir, 0750)
+ os.chmod(self.top_dir, 0o750)
self.dir = os.path.join(self.top_dir, "ipa")
- os.mkdir(self.dir, 0750)
+ os.mkdir(self.dir, 0o750)
os.chown(self.dir, pent.pw_uid, pent.pw_gid)
@@ -554,7 +554,7 @@ class Backup(admintool.AdminTool):
backup_dir = os.path.join(paths.IPA_BACKUP_DIR, time.strftime('ipa-full-%Y-%m-%d-%H-%M-%S'))
filename = os.path.join(backup_dir, "ipa-full.tar")
- os.mkdir(backup_dir, 0700)
+ os.mkdir(backup_dir, 0o700)
cwd = os.getcwd()
os.chdir(self.dir)
@@ -585,7 +585,7 @@ class Backup(admintool.AdminTool):
if instance != 'PKI-IPA':
return os.path.join(paths.VAR_LIB_DIRSRV, 'scripts-%s' % instance)
else:
- if sys.maxsize > 2**32L:
+ if sys.maxsize > 2**32:
libpath = 'lib64'
else:
libpath = 'lib'