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
Jérome Perrin
slapos.core
Commits
1209daa2
Commit
1209daa2
authored
May 11, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'slapos proxy start' command
parent
3fd2f507
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
2 deletions
+45
-2
setup.py
setup.py
+1
-0
slapos/cli/proxy.py
slapos/cli/proxy.py
+42
-0
slapos/cli_legacy/proxy.py
slapos/cli_legacy/proxy.py
+2
-2
No files found.
setup.py
View file @
1209daa2
...
@@ -86,6 +86,7 @@ setup(name=name,
...
@@ -86,6 +86,7 @@ setup(name=name,
'node software = slapos.cli.slapgrid:SoftwareCommand'
,
'node software = slapos.cli.slapgrid:SoftwareCommand'
,
'node instance = slapos.cli.slapgrid:InstanceCommand'
,
'node instance = slapos.cli.slapgrid:InstanceCommand'
,
'console = slapos.cli.console:ConsoleCommand'
,
'console = slapos.cli.console:ConsoleCommand'
,
'proxy start = slapos.cli.proxy:ProxyCommand'
,
'supply = slapos.cli.supply:SupplyCommand'
,
'supply = slapos.cli.supply:SupplyCommand'
,
'remove = slapos.cli.remove:RemoveCommand'
,
'remove = slapos.cli.remove:RemoveCommand'
,
'request = slapos.cli.request:RequestCommand'
,
'request = slapos.cli.request:RequestCommand'
,
...
...
slapos/cli/proxy.py
0 → 100644
View file @
1209daa2
# -*- coding: utf-8 -*-
import
logging
from
slapos.cli.config
import
ConfigCommand
from
slapos.proxy
import
do_proxy
,
ProxyConfig
class
ProxyCommand
(
ConfigCommand
):
"""
minimalist, stand-alone SlapOS Master
"""
log
=
logging
.
getLogger
(
'proxy'
)
def
get_parser
(
self
,
prog_name
):
ap
=
super
(
ProxyCommand
,
self
).
get_parser
(
prog_name
)
ap
.
add_argument
(
'-u'
,
'--database-uri'
,
help
=
'URI for sqlite database'
)
return
ap
def
take_action
(
self
,
args
):
configp
=
self
.
fetch_config
(
args
)
conf
=
ProxyConfig
(
logger
=
self
.
log
)
conf
.
mergeConfig
(
args
,
configp
)
if
not
self
.
app
.
options
.
log_file
and
hasattr
(
conf
,
'log_file'
):
# no log file is provided by argparser,
# we set up the one from config
file_handler
=
logging
.
FileHandler
(
conf
.
log_file
)
formatter
=
logging
.
Formatter
(
self
.
app
.
LOG_FILE_MESSAGE_FORMAT
)
file_handler
.
setFormatter
(
formatter
)
self
.
log
.
addHandler
(
file_handler
)
conf
.
setConfig
()
do_proxy
(
conf
=
conf
)
slapos/cli_legacy/proxy.py
View file @
1209daa2
...
@@ -41,10 +41,10 @@ def main():
...
@@ -41,10 +41,10 @@ def main():
if
args
.
verbose
:
if
args
.
verbose
:
logger
.
setLevel
(
logging
.
DEBUG
)
logger
.
setLevel
(
logging
.
DEBUG
)
else
:
else
:
logger
.
setLevel
(
logging
.
INFO
)
logger
.
setLevel
(
logging
.
INFO
)
conf
=
ProxyConfig
(
logger
)
conf
=
ProxyConfig
(
logger
=
logger
)
configp
=
ConfigParser
.
SafeConfigParser
()
configp
=
ConfigParser
.
SafeConfigParser
()
if
configp
.
read
(
args
.
configuration_file
)
!=
[
args
.
configuration_file
]:
if
configp
.
read
(
args
.
configuration_file
)
!=
[
args
.
configuration_file
]:
...
...
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