Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vnf-onboarding
OSM Packages
Commits
45ba2068
Commit
45ba2068
authored
Jun 01, 2020
by
garciadav
Browse files
Fix magmagw: race condition when orch not ready yet
parent
396ee6d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
magma/hackfest_magma-agw-enb_vnfd/charms/magmagw/src/charm.py
...a/hackfest_magma-agw-enb_vnfd/charms/magmagw/src/charm.py
+14
-5
No files found.
magma/hackfest_magma-agw-enb_vnfd/charms/magmagw/src/charm.py
View file @
45ba2068
...
...
@@ -173,11 +173,20 @@ class SimpleHAProxyCharm(CharmBase):
orch_ip
=
event
.
params
[
"orch_ip"
]
orch_net
=
event
.
params
[
"orch_net"
]
proxy
=
self
.
get_ssh_proxy
()
stdout
,
stderr
=
proxy
.
run
(
"/home/magma/addnet.py --orch_ip {} --orch_net {}"
.
format
(
orch_ip
,
orch_net
)
)
attempt
=
0
while
attempt
<
50
:
try
:
stdout
,
stderr
=
proxy
.
run
(
"/home/magma/addnet.py --orch_ip {} --orch_net {}"
.
format
(
orch_ip
,
orch_net
)
)
break
except
subprocess
.
CalledProcessError
:
attempt
+=
1
import
time
time
.
sleep
(
5
)
event
.
set_results
({
"output"
:
stdout
,
"stderr"
:
stderr
})
else
:
event
.
fail
(
"Unit is not leader"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment