Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
63b2e2d7
Commit
63b2e2d7
authored
Aug 01, 2011
by
Antoine Catton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass promise timeout as parameter
(either in config file or in command line) Not tested yet
parent
301bd38b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
slapos/grid/slapgrid.py
slapos/grid/slapgrid.py
+11
-3
No files found.
slapos/grid/slapgrid.py
View file @
63b2e2d7
...
@@ -64,6 +64,8 @@ MANDATORY_PARAMETER_LIST = [
...
@@ -64,6 +64,8 @@ MANDATORY_PARAMETER_LIST = [
'software_root'
,
'software_root'
,
]
]
DEFAULT_PROMISE_TIMEOUT
=
3
def
parseArgumentTupleAndReturnSlapgridObject
(
*
argument_tuple
):
def
parseArgumentTupleAndReturnSlapgridObject
(
*
argument_tuple
):
"""Parses arguments either from command line, from method parameters or from
"""Parses arguments either from command line, from method parameters or from
...
@@ -106,6 +108,9 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
...
@@ -106,6 +108,9 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
help
=
"Enables console output and live output from subcommands."
)
help
=
"Enables console output and live output from subcommands."
)
parser
.
add_argument
(
"-v"
,
"--verbose"
,
action
=
"store_true"
,
default
=
False
,
parser
.
add_argument
(
"-v"
,
"--verbose"
,
action
=
"store_true"
,
default
=
False
,
help
=
"Be verbose."
)
help
=
"Be verbose."
)
parser
.
add_argument
(
"--promise-timeout"
,
type
=
int
,
default
=
DEFAULT_PROMISE_TIMEOUT
,
help
=
"Promise timeout in seconds."
)
parser
.
add_argument
(
"configuration_file"
,
nargs
=
1
,
type
=
argparse
.
FileType
(),
parser
.
add_argument
(
"configuration_file"
,
nargs
=
1
,
type
=
argparse
.
FileType
(),
help
=
"SlapOS configuration file."
)
help
=
"SlapOS configuration file."
)
...
@@ -199,7 +204,8 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
...
@@ -199,7 +204,8 @@ def parseArgumentTupleAndReturnSlapgridObject(*argument_tuple):
master_ca_file
=
master_ca_file
,
master_ca_file
=
master_ca_file
,
certificate_repository_path
=
certificate_repository_path
,
certificate_repository_path
=
certificate_repository_path
,
console
=
option_dict
[
'console'
],
console
=
option_dict
[
'console'
],
buildout
=
option_dict
.
get
(
'buildout'
)),
buildout
=
option_dict
.
get
(
'buildout'
),
promise_timeout
=
option_dict
[
'promise-timeout'
]),
option_dict
])
option_dict
])
...
@@ -268,7 +274,8 @@ class Slapgrid(object):
...
@@ -268,7 +274,8 @@ class Slapgrid(object):
cert_file
=
None
,
cert_file
=
None
,
master_ca_file
=
None
,
master_ca_file
=
None
,
certificate_repository_path
=
None
,
certificate_repository_path
=
None
,
console
=
False
):
console
=
False
,
promise_timeout
=
DEFAULT_PROMISE_TIMEOUT
):
"""Makes easy initialisation of class parameters"""
"""Makes easy initialisation of class parameters"""
# Parses arguments
# Parses arguments
self
.
software_root
=
os
.
path
.
abspath
(
software_root
)
self
.
software_root
=
os
.
path
.
abspath
(
software_root
)
...
@@ -295,6 +302,7 @@ class Slapgrid(object):
...
@@ -295,6 +302,7 @@ class Slapgrid(object):
os
.
path
.
join
(
self
.
instance_etc_directory
,
'supervisord.conf.d'
)
os
.
path
.
join
(
self
.
instance_etc_directory
,
'supervisord.conf.d'
)
self
.
console
=
console
self
.
console
=
console
self
.
buildout
=
buildout
self
.
buildout
=
buildout
self
.
promise_timeout
=
DEFAULT_PROMISE_TIMEOUT
def
checkEnvironmentAndCreateStructure
(
self
):
def
checkEnvironmentAndCreateStructure
(
self
):
"""Checks for software_root and instance_root existence, then creates
"""Checks for software_root and instance_root existence, then creates
...
@@ -567,7 +575,7 @@ class Slapgrid(object):
...
@@ -567,7 +575,7 @@ class Slapgrid(object):
self
.
_runCommandAsUserAndYieldPopen
(
commands_to_run
,
self
.
_runCommandAsUserAndYieldPopen
(
commands_to_run
,
(
uid
,
gid
),
cwd
):
(
uid
,
gid
),
cwd
):
time
.
sleep
(
3
)
# 3 seconds timeout
time
.
sleep
(
self
.
promise_timeout
)
promise
=
os
.
path
.
basename
(
command
)
promise
=
os
.
path
.
basename
(
command
)
...
...
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