Python 3 compatibility: fix oldoctinteger

For Python 3.0, "oldoctinteger" isn't supported already, and an exception
will be raised if a literal has a leading "0" and a second character
which is a digit.

Story: 2003433
Task: 25734

Change-Id: I91f64c8d9cd670c83f5307638da9ae987612813e
Signed-off-by: zhangyangyang <zhangyangyang@unionpay.com>
This commit is contained in:
youngdq 2018-09-01 15:04:12 +08:00 committed by zhangyangyang
parent f19dd0498f
commit e0ad6c479e
3 changed files with 8 additions and 8 deletions

View File

@ -846,7 +846,7 @@ def restore_ldap(archive, ldap_permdir, staging_dir):
utils.stop_lsb_service('openldap')
subprocess.call(['rm', '-rf', ldap_permdir], stdout=DEVNULL)
os.mkdir(ldap_permdir, 0755)
os.mkdir(ldap_permdir, 0o755)
subprocess.check_call(['slapadd', '-F', '/etc/openldap/schema',
'-l', ldap_staging_dir + '/ldap.db'],

View File

@ -392,12 +392,12 @@ def create_iso(iso_name, archive_dir):
iso_patch_committed_dir = os.path.join(iso_patch_metadata_dir,
'committed')
os.mkdir(iso_patches_dir, 0755)
os.mkdir(iso_patch_repo_dir, 0755)
os.mkdir(iso_patch_pkgs_dir, 0755)
os.mkdir(iso_patch_metadata_dir, 0755)
os.mkdir(iso_patch_applied_dir, 0755)
os.mkdir(iso_patch_committed_dir, 0755)
os.mkdir(iso_patches_dir, 0o755)
os.mkdir(iso_patch_repo_dir, 0o755)
os.mkdir(iso_patch_pkgs_dir, 0o755)
os.mkdir(iso_patch_metadata_dir, 0o755)
os.mkdir(iso_patch_applied_dir, 0o755)
os.mkdir(iso_patch_committed_dir, 0o755)
repodata = '/www/pages/updates/rel-%s/repodata/' % tsconfig.SW_VERSION
pkgsdir = '/www/pages/updates/rel-%s/Packages/' % tsconfig.SW_VERSION

View File

@ -114,7 +114,7 @@ def prepare_upgrade(from_load, to_load, i_system):
(from_load, to_load))
dest_dir = os.path.join(utils.POSTGRES_PATH, "upgrade")
try:
os.mkdir(dest_dir, 0755)
os.mkdir(dest_dir, 0o755)
except OSError:
LOG.exception("Failed to create upgrade export directory %s." %
dest_dir)