9f0e32eab4
Move content from stx-gplv3 into stx-integ Packages will be relocated to stx-integ: base/ anaconda crontabs dnsmasq rsync database/ python-psycopg2 filesystem/ parted grub/ grub2 security/ python-keyring Change-Id: I17163dbff41222985a29228a8b42c919a86d1e67 Story: 2002801 Task: 22687 Signed-off-by: Scott Little <scott.little@windriver.com>
43 lines
1.5 KiB
Diff
43 lines
1.5 KiB
Diff
Index: keyring-5.3/keyring/backends/file.py
|
|
===================================================================
|
|
--- keyring-5.3.orig/keyring/backends/file.py
|
|
+++ keyring-5.3/keyring/backends/file.py
|
|
@@ -92,10 +92,6 @@ class BaseKeyring(FileBacked, KeyringBac
|
|
# ensure the file exists
|
|
self._ensure_file_path()
|
|
|
|
- # load the keyring from the disk
|
|
- config = configparser.RawConfigParser()
|
|
- config.read(self.file_path)
|
|
-
|
|
# obtain lock for the keyring file
|
|
lock = ''
|
|
i = 60
|
|
@@ -107,15 +103,21 @@ class BaseKeyring(FileBacked, KeyringBac
|
|
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)
|
|
|
|
if i:
|
|
- # save the keyring back to the file
|
|
+ # Load the keyring from the disk
|
|
+ config = configparser.RawConfigParser()
|
|
+ config.read(self.file_path)
|
|
+
|
|
+ # 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)
|
|
+
|
|
lock.close()
|
|
os.remove('/tmp/.keyringlock')
|
|
|