Merge ~tasdomas/influxdb-charm:sleep-retry into influxdb-charm:master

Proposed by Domas Monkus
Status: Merged
Approved by: Jamon Camisso
Approved revision: 0258b5cfc5dca1c52d5a8935169cebe1270f0b36
Merged at revision: 1d39d13650a579f1471bc15d364036b5d063dee3
Proposed branch: ~tasdomas/influxdb-charm:sleep-retry
Merge into: influxdb-charm:master
Diff against target: 19 lines (+2/-0)
1 file modified
lib/influxdbcharmlib.py (+2/-0)
Reviewer Review Type Date Requested Status
Junien F Approve
Review via email: mp+362451@code.launchpad.net

Commit message

When retrying user creation during the charm setup, the charm should sleep between retries. Otherwise there is still a high probability of exhausting the retries before the server actually comes up.

Description of the change

Added 5 second sleeps between user creation retries.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Junien F (axino) wrote :

+1

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 1d39d13650a579f1471bc15d364036b5d063dee3

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/influxdbcharmlib.py b/lib/influxdbcharmlib.py
2index da6246b..4bf06b5 100644
3--- a/lib/influxdbcharmlib.py
4+++ b/lib/influxdbcharmlib.py
5@@ -1,5 +1,6 @@
6 import os
7 import pwd
8+import time
9 import uuid
10
11 import influxdb
12@@ -44,6 +45,7 @@ def create_influxdb_user(username, admin=False, local_user=None):
13 n = n - 1
14 if n <= 0:
15 raise ex
16+ time.sleep(5)
17
18 if local_user:
19 passwd_entry = pwd.getpwnam(local_user)

Subscribers

People subscribed via source and target branches

to all changes: