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
Lu Xu
slapos.core
Commits
994c73f5
Commit
994c73f5
authored
Jul 30, 2018
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proxy: create empty slaproxy database if not exits yet
parent
2ba08c68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
slapos/proxy/__init__.py
slapos/proxy/__init__.py
+7
-0
No files found.
slapos/proxy/__init__.py
View file @
994c73f5
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
import
logging
import
logging
from
slapos.proxy.views
import
app
from
slapos.proxy.views
import
app
from
slapos.util
import
sqlite_connect
def
_generateSoftwareProductListFromString
(
software_product_list_string
):
def
_generateSoftwareProductListFromString
(
software_product_list_string
):
"""
"""
...
@@ -91,10 +92,16 @@ def setupFlaskConfiguration(conf):
...
@@ -91,10 +92,16 @@ def setupFlaskConfiguration(conf):
app
.
config
[
'software_product_list'
]
=
conf
.
software_product_list
app
.
config
[
'software_product_list'
]
=
conf
.
software_product_list
app
.
config
[
'multimaster'
]
=
conf
.
multimaster
app
.
config
[
'multimaster'
]
=
conf
.
multimaster
def
connectDB
():
# if first connection, create an empty db at DATABASE_URI path
conn
=
sqlite_connect
(
app
.
config
[
'DATABASE_URI'
])
conn
.
close
()
def
do_proxy
(
conf
):
def
do_proxy
(
conf
):
for
handler
in
conf
.
logger
.
handlers
:
for
handler
in
conf
.
logger
.
handlers
:
app
.
logger
.
addHandler
(
handler
)
app
.
logger
.
addHandler
(
handler
)
app
.
logger
.
setLevel
(
logging
.
INFO
)
app
.
logger
.
setLevel
(
logging
.
INFO
)
setupFlaskConfiguration
(
conf
)
setupFlaskConfiguration
(
conf
)
connectDB
()
app
.
run
(
host
=
conf
.
host
,
port
=
int
(
conf
.
port
),
threaded
=
True
)
app
.
run
(
host
=
conf
.
host
,
port
=
int
(
conf
.
port
),
threaded
=
True
)
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