Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
devops
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osm
devops
Commits
24a06f01
Commit
24a06f01
authored
7 years ago
by
Philip Joseph
Browse files
Options
Downloads
Patches
Plain Diff
Bug 234 : Add timeout to commands for pingpong
Signed-off-by:
Philip Joseph
<
philip.joseph@riftio.com
>
parent
b735a90b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
layers/pingpong/reactive/pingpong.py
+5
-5
5 additions, 5 deletions
layers/pingpong/reactive/pingpong.py
with
5 additions
and
5 deletions
layers/pingpong/reactive/pingpong.py
+
5
−
5
View file @
24a06f01
...
...
@@ -55,7 +55,7 @@ def start():
try
:
# Bring up the eth1 interface.
# The selinux label on the file needs to be set correctly
cmd
=
"
sudo /sbin/restorecon -v /etc/sysconfig/network-scripts/ifcfg-eth1
"
cmd
=
"
sudo
timeout 5
/sbin/restorecon -v /etc/sysconfig/network-scripts/ifcfg-eth1
"
result
,
err
=
charms
.
sshproxy
.
_run
(
cmd
)
except
Exception
as
e
:
err
=
"
{}
"
.
format
(
e
)
...
...
@@ -64,7 +64,7 @@ def start():
return
try
:
cmd
=
"
sudo /sbin/ifup eth1
"
cmd
=
"
sudo
timeout 30
/sbin/ifup eth1
"
result
,
err
=
charms
.
sshproxy
.
_run
(
cmd
)
except
Exception
as
e
:
action_fail
(
'
command failed: {}, errors: {}
'
.
format
(
e
,
e
.
output
))
...
...
@@ -72,7 +72,7 @@ def start():
return
try
:
cmd
=
"
sudo /usr/bin/systemctl start {}
"
.
\
cmd
=
"
sudo
timeout 30
/usr/bin/systemctl start {}
"
.
\
format
(
cfg
[
'
mode
'
])
result
,
err
=
charms
.
sshproxy
.
_run
(
cmd
)
except
Exception
as
e
:
...
...
@@ -89,7 +89,7 @@ def start():
def
stop
():
try
:
# Enter the command to stop your service(s)
cmd
=
"
sudo /usr/bin/systemctl stop {}
"
.
format
(
cfg
[
'
mode
'
])
cmd
=
"
sudo
timeout 30
/usr/bin/systemctl stop {}
"
.
format
(
cfg
[
'
mode
'
])
result
,
err
=
charms
.
sshproxy
.
_run
(
cmd
)
except
Exception
as
e
:
action_fail
(
'
command failed: {}, errors: {}
'
.
format
(
e
,
e
.
output
))
...
...
@@ -105,7 +105,7 @@ def stop():
def
restart
():
try
:
# Enter the command to restart your service(s)
cmd
=
"
sudo /usr/bin/systemctl restart {}
"
.
format
(
cfg
[
'
mode
'
])
cmd
=
"
sudo
timeout 30
/usr/bin/systemctl restart {}
"
.
format
(
cfg
[
'
mode
'
])
result
,
err
=
charms
.
sshproxy
.
_run
(
cmd
)
except
Exception
as
e
:
action_fail
(
'
command failed: {}, errors: {}
'
.
format
(
e
,
e
.
output
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment