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
20
Merge Requests
20
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
nexedi
slapos.core
Commits
3a33df9d
Commit
3a33df9d
authored
Feb 17, 2020
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Plain Diff
Fixes for python3.6
/reviewed-on
nexedi/slapos.core!146
parents
3bc0dd76
dcfbb594
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
19 deletions
+37
-19
setup.py
setup.py
+17
-15
slapos/cli/register.py
slapos/cli/register.py
+1
-1
slapos/collect/db.py
slapos/collect/db.py
+2
-2
slapos/slap/standalone.py
slapos/slap/standalone.py
+17
-1
No files found.
setup.py
View file @
3a33df9d
...
...
@@ -28,8 +28,20 @@ try:
except
ImportError
:
additional_install_requires
.
append
(
'argparse'
)
if
sys
.
version_info
[
0
]
<
3
:
additional_install_requires
.
append
(
'subprocess32'
)
extras_require
=
{
'docs'
:
(
'Sphinx'
,
'repoze.sphinx.autointerface'
,
'sphinxcontrib.programoutput'
,
),
'ipython_console'
:
(
'ipython'
,),
'bpython_console'
:
(
'bpython'
,),
'test'
:
(
'pyflakes'
,
'mock'
,
'httmock'
,
),
}
setup
(
name
=
name
,
version
=
version
,
...
...
@@ -63,20 +75,10 @@ setup(name=name,
'cachecontrol'
,
'lockfile'
,
'uritemplate'
,
# used by hateoas navigator
'subprocess32; python_version<"3"'
]
+
additional_install_requires
,
extras_require
=
{
'docs'
:
(
'Sphinx'
,
'repoze.sphinx.autointerface'
,
'sphinxcontrib.programoutput'
),
'ipython_console'
:
(
'ipython'
,),
'bpython_console'
:
(
'bpython'
,)},
tests_require
=
[
'pyflakes'
,
'mock'
,
'httmock'
,
],
extras_require
=
extras_require
,
tests_require
=
extras_require
[
'test'
],
zip_safe
=
False
,
# proxy depends on Flask, which has issues with
# accessing templates
entry_points
=
{
...
...
slapos/cli/register.py
View file @
3a33df9d
...
...
@@ -279,7 +279,7 @@ def slapconfig(conf):
to_replace
.
append
((
'ipv6_interface'
,
conf
.
ipv6_interface
))
for
key
,
value
in
to_replace
:
cfg
=
re
.
sub
(
'
\
n
\
s*%s
\
s*=.*'
%
key
,
'
\
n
%s = %s'
%
(
key
,
value
),
cfg
)
cfg
=
re
.
sub
(
'
\
n
\
\
s*%s
\
\
s*=.*'
%
key
,
'
\
n
%s = %s'
%
(
key
,
value
),
cfg
)
if
not
dry_run
:
with
open
(
config_path
,
'w'
)
as
fout
:
...
...
slapos/collect/db.py
View file @
3a33df9d
...
...
@@ -300,9 +300,9 @@ class Database:
self
.
_execute
(
delete_sql
%
(
table
,
where_clause
))
vacuum
=
1
if
vacuum
:
self
.
_execute
(
"VACUUM;"
)
self
.
commit
()
if
vacuum
:
self
.
_execute
(
"VACUUM"
)
self
.
close
()
def
getDateScopeList
(
self
,
ignore_date
=
None
,
reported
=
0
):
...
...
slapos/slap/standalone.py
View file @
3a33df9d
...
...
@@ -643,7 +643,11 @@ class StandaloneSlapOS(object):
debug_args
=
prog
.
get
(
'debug_args'
,
''
)
# pylint: disable=unused-variable
command
=
prog
[
'command'
].
format
(
**
locals
())
try
:
return
subprocess
.
check_call
(
command
,
shell
=
True
)
return
subprocess
.
check_call
(
command
,
shell
=
True
,
env
=
self
.
_getSubprocessEnvironment
(),
)
except
subprocess
.
CalledProcessError
as
e
:
if
e
.
returncode
==
SLAPGRID_PROMISE_FAIL
:
self
.
_logger
.
exception
(
'Promise error when running %s'
,
command
)
...
...
@@ -706,6 +710,7 @@ class StandaloneSlapOS(object):
output
=
subprocess
.
check_output
(
[
'supervisord'
,
'--configuration'
,
self
.
_supervisor_config
],
cwd
=
self
.
_base_directory
,
env
=
self
.
_getSubprocessEnvironment
(),
)
self
.
_logger
.
debug
(
"Started new supervisor: %s"
,
output
)
...
...
@@ -736,3 +741,14 @@ class StandaloneSlapOS(object):
return
time
.
sleep
(
i
*
.
01
)
raise
RuntimeError
(
"SlapOS not started"
)
def
_getSubprocessEnvironment
(
self
):
# Running tests with `python setup.py test` sets a PYTHONPATH that
# is suitable for current python, but problematic when this process
# runs another version of python in subprocess.
if
'PYTHONPATH'
in
os
.
environ
:
self
.
_logger
.
warning
(
"Removing $PYTHONPATH from environment for subprocess"
)
env
=
os
.
environ
.
copy
()
del
env
[
'PYTHONPATH'
]
return
env
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