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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
slapos.core
Commits
aec84014
Commit
aec84014
authored
Oct 18, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quickly fix 'slapos node' supervisor commands
parent
3748a55b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
slapos/entry.py
slapos/entry.py
+12
-10
No files found.
slapos/entry.py
View file @
aec84014
...
@@ -124,8 +124,9 @@ def dispatch(command, is_node_command):
...
@@ -124,8 +124,9 @@ def dispatch(command, is_node_command):
elif
command
==
'format'
:
elif
command
==
'format'
:
call
(
format
,
config
=
GLOBAL_SLAPOS_CONFIGURATION
,
option
=
[
'-c'
])
call
(
format
,
config
=
GLOBAL_SLAPOS_CONFIGURATION
,
option
=
[
'-c'
])
elif
command
in
[
'start'
,
'stop'
,
'status'
,
'tail'
]:
elif
command
in
[
'start'
,
'stop'
,
'status'
,
'tail'
]:
supervisord
()
# Again, too hackish
supervisorctl
()
sys
.
argv
[
-
2
:
-
2
]
=
[
command
]
call
(
supervisorctl
,
config
=
GLOBAL_SLAPOS_CONFIGURATION
)
else
:
else
:
return
False
return
False
elif
command
==
'request'
:
elif
command
==
'request'
:
...
@@ -146,21 +147,22 @@ def main():
...
@@ -146,21 +147,22 @@ def main():
Main entry point of SlapOS Node. Used to dispatch commands to python
Main entry point of SlapOS Node. Used to dispatch commands to python
module responsible of the operation.
module responsible of the operation.
"""
"""
# XXX-Cedric: add "description" for parser.
# Parse arguments
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'command'
)
# XXX-Cedric: "slapos node" should display "supervisorctl status".
# Currently it does nothing
parser
.
add_argument
(
'argument_list'
,
nargs
=
argparse
.
REMAINDER
)
# If "node" arg is the first: we strip it and set a switch
# If "node" arg is the first: we strip it and set a switch
if
len
(
sys
.
argv
)
>
1
and
sys
.
argv
[
1
]
==
"node"
:
if
len
(
sys
.
argv
)
>
1
and
sys
.
argv
[
1
]
==
"node"
:
sys
.
argv
.
pop
(
1
)
sys
.
argv
.
pop
(
1
)
# Hackish way to show status if no argument is specified
if
len
(
sys
.
argv
)
is
1
:
sys
.
argv
.
append
(
'status'
)
is_node
=
True
is_node
=
True
else
:
else
:
is_node
=
False
is_node
=
False
# XXX-Cedric: add "description" for parser.
# Parse arguments
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'command'
)
parser
.
add_argument
(
'argument_list'
,
nargs
=
argparse
.
REMAINDER
)
namespace
=
parser
.
parse_args
()
namespace
=
parser
.
parse_args
()
# Set sys.argv for the sub-entry point that we will call
# Set sys.argv for the sub-entry point that we will call
command_line
=
[
namespace
.
command
]
command_line
=
[
namespace
.
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