X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=meta-starlingx%2Fmeta-stx-cloud%2Frecipes-devtools%2Fpython%2Ffiles%2Fpython-keyring%2Flock_keyring_file.patch;fp=meta-starlingx%2Fmeta-stx-cloud%2Frecipes-devtools%2Fpython%2Ffiles%2Fpython-keyring%2Flock_keyring_file.patch;h=0000000000000000000000000000000000000000;hb=6fc6934434f70595536a387ece31bc30141cafb5;hp=dab72486da64c22e07cef991527b4de8db32c76c;hpb=eb1e26510491ba49de693ab3b0498edcb06be6c5;p=pti%2Frtp.git diff --git a/meta-starlingx/meta-stx-cloud/recipes-devtools/python/files/python-keyring/lock_keyring_file.patch b/meta-starlingx/meta-stx-cloud/recipes-devtools/python/files/python-keyring/lock_keyring_file.patch deleted file mode 100644 index dab7248..0000000 --- a/meta-starlingx/meta-stx-cloud/recipes-devtools/python/files/python-keyring/lock_keyring_file.patch +++ /dev/null @@ -1,45 +0,0 @@ -Index: keyring-5.3/keyring/backends/file.py -=================================================================== ---- keyring-5.3.orig/keyring/backends/file.py -+++ keyring-5.3/keyring/backends/file.py -@@ -6,6 +6,7 @@ import base64 - import sys - import json - import abc -+import time - - from ..py27compat import configparser - -@@ -95,14 +96,29 @@ class BaseKeyring(FileBacked, KeyringBac - config = configparser.RawConfigParser() - config.read(self.file_path) - -+ # obtain lock for the keyring file -+ lock = '' -+ i = 60 -+ while i: -+ if not os.path.isfile('/tmp/.keyringlock'): -+ lock = open('/tmp/.keyringlock', 'w') -+ break -+ else: -+ time.sleep(0.500) -+ i=i-1 -+ - # update the keyring with the password - if not config.has_section(service): - config.add_section(service) - config.set(service, username, password_base64) - -- # save the keyring back to the file -- with open(self.file_path, 'w') as config_file: -- config.write(config_file) -+ if i: -+ # save the keyring back to the file -+ with open(self.file_path, 'w') as config_file: -+ config.write(config_file) -+ lock.close() -+ os.remove('/tmp/.keyringlock') -+ - - def _ensure_file_path(self): - """