From b8c46f2a32d0d8c2dc6ef0867f85f63cf076a004 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 15 Jul 2015 16:38:06 +0200 Subject: 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 --- ipaserver/install/server/install.py | 6 +++--- ipaserver/install/server/replicainstall.py | 4 ++-- ipaserver/install/server/upgrade.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'ipaserver/install/server') diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py index b9bf3f34b..015050aa7 100644 --- a/ipaserver/install/server/install.py +++ b/ipaserver/install/server/install.py @@ -580,7 +580,7 @@ def install_check(installer): fd.close() # Must be readable for everyone - os.chmod(target_fname, 0644) + os.chmod(target_fname, 0o644) system_hostname = get_fqdn() if host_name != system_hostname: @@ -770,7 +770,7 @@ def install(installer): else: # Put the CA cert where other instances expect it x509.write_certificate(http_ca_cert, CACERT) - os.chmod(CACERT, 0444) + os.chmod(CACERT, 0o444) # we now need to enable ssl on the ds ds.enable_ssl() @@ -821,7 +821,7 @@ def install(installer): # Export full CA chain ca_db = certs.CertDB(realm_name) - os.chmod(CACERT, 0644) + os.chmod(CACERT, 0o644) ca_db.publish_ca_cert(CACERT) set_subject_in_config(realm_name, dm_password, diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py index 1ad291a1e..a0ae53438 100644 --- a/ipaserver/install/server/replicainstall.py +++ b/ipaserver/install/server/replicainstall.py @@ -105,7 +105,7 @@ def install_ca_cert(ldap, base_dn, realm, cafile): certs = [c[0] for c in certs if c[2] is not False] x509.write_certificate_list(certs, constants.CACERT) - os.chmod(constants.CACERT, 0444) + os.chmod(constants.CACERT, 0o444) except Exception, e: print "error copying files: " + str(e) sys.exit(1) @@ -358,7 +358,7 @@ def install_check(installer): # Create the management framework config file # Note: We must do this before bootstraping and finalizing ipalib.api - old_umask = os.umask(022) # must be readable for httpd + old_umask = os.umask(0o22) # must be readable for httpd try: fd = open(paths.IPA_DEFAULT_CONF, "w") fd.write("[global]\n") diff --git a/ipaserver/install/server/upgrade.py b/ipaserver/install/server/upgrade.py index f295655dc..a342642b0 100644 --- a/ipaserver/install/server/upgrade.py +++ b/ipaserver/install/server/upgrade.py @@ -175,7 +175,7 @@ def check_certs(): if not os.path.exists(paths.CA_CRT): ca_file = paths.ALIAS_CACERT_ASC if os.path.exists(ca_file): - old_umask = os.umask(022) # make sure its readable by httpd + old_umask = os.umask(0o22) # make sure its readable by httpd try: shutil.copyfile(ca_file, paths.CA_CRT) finally: -- cgit