Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
argo
argotk
Commits
7cea5526
Commit
7cea5526
authored
Mar 22, 2019
by
Valentin Reis
Browse files
Fix sudo call in argotk
parent
106eb84e
Pipeline
#6136
passed with stages
in 2 minutes and 36 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Argo/Stack.hs
View file @
7cea5526
...
...
@@ -47,6 +47,7 @@ import System.Process.Typed ( readProcessStdout_
,
proc
,
shell
,
setEnv
,
setEnvInherit
)
import
Text.Show.Pretty
...
...
@@ -57,7 +58,7 @@ cleanLeftovers (WorkingDirectory wd) = do
putText
"Cleaning output directory."
runProcess
(
shell
$
toS
$
"rm -rf "
<>
wd
)
>>=
\
case
ExitSuccess
->
putText
"Cleaned output directory"
ExitFailure
_
->
putText
"Failed running rm -rf on the output directory."
ExitFailure
_
->
die
"Failed running rm -rf on the output directory."
where
socklist
=
[
"/tmp/nrm-downstream-in"
...
...
@@ -97,12 +98,12 @@ prepareDaemon out stdErr test v powercap vars = do
putText
"Contents of .argo_nodeos_config_exit_message: "
*>
(
readFile
".argo_nodeos_config_exit_message"
>>=
print
)
False
->
die
(
"argo_nodeos_config failed with exit code "
<>
show
n
)
cleanContainers
::
FilePath
->
IO
()
cleanContainers
::
Text
->
IO
()
cleanContainers
argo_nodeos_config
=
runProcess
(
setEnv
(
castArg
<$>
vars
)
$
proc
"sudo"
[
argo_nodeos_config
,
"--clean_config=kill_content:true"
]
(
proc
(
toS
argo_nodeos_config
)
$
toS
<$>
[
argo_nodeos_config
,
"--clean_config=kill_content:true"
]
)
>>=
\
case
ExitFailure
n
->
nodeOsFailure
n
...
...
src/Argo/Utils.hs
View file @
7cea5526
...
...
@@ -92,7 +92,7 @@ myWhich str =
""
->
die
$
"Argo `"
<>
str
<>
"` not in $PATH."
p
->
printInfo
(
"Found "
<>
str
<>
" at "
<>
p
)
$>
p
sudoRemoveFile
::
(
Text
->
IO
()
)
->
Text
->
Text
->
IO
()
sudoRemoveFile
::
(
Text
->
IO
()
)
->
Text
->
Text
->
IO
()
sudoRemoveFile
printer
desc
filePath
=
do
foundSocket
<-
doesFileExist
$
toS
filePath
when
foundSocket
$
go
False
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment