Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.build
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
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.recipe.build
Commits
7dae0407
Commit
7dae0407
authored
Nov 28, 2014
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup.
parent
1b313999
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
11 deletions
+6
-11
setup.py
setup.py
+1
-1
slapos/recipe/build/__init__.py
slapos/recipe/build/__init__.py
+2
-4
slapos/recipe/build/tests.py
slapos/recipe/build/tests.py
+2
-6
slapos/recipe/gitclone.py
slapos/recipe/gitclone.py
+1
-0
No files found.
setup.py
View file @
7dae0407
...
@@ -24,7 +24,7 @@ setup(name=name,
...
@@ -24,7 +24,7 @@ setup(name=name,
include_package_data
=
True
,
include_package_data
=
True
,
install_requires
=
[
install_requires
=
[
'setuptools'
,
# namespaces
'setuptools'
,
# namespaces
'zc.buildout'
,
# plays with buildout
'zc.buildout
<2.0.0
'
,
# plays with buildout
'slapos.libnetworkcache>=0.13.1'
,
# Uses helper new in this version
'slapos.libnetworkcache>=0.13.1'
,
# Uses helper new in this version
],
],
extras_require
=
{
extras_require
=
{
...
...
slapos/recipe/build/__init__.py
View file @
7dae0407
...
@@ -181,8 +181,8 @@ class Script:
...
@@ -181,8 +181,8 @@ class Script:
else
:
else
:
raise
zc
.
buildout
.
UserError
(
'Unknown promise %r'
%
promise
)
raise
zc
.
buildout
.
UserError
(
'Unknown promise %r'
%
promise
)
if
len
(
promise_problem_list
):
if
len
(
promise_problem_list
):
raise
zc
.
buildout
.
UserError
(
'Promise not met, found issues:
\
n
%s'
%
raise
zc
.
buildout
.
UserError
(
'Promise not met, found issues:
\
n
%s
\
n
'
%
'
'
.
join
([
q
+
'
\
n
'
for
q
in
promise_problem_list
]
))
'
\
n
'
.
join
(
promise_problem_list
))
def
download
(
self
,
url
,
md5sum
=
None
):
def
download
(
self
,
url
,
md5sum
=
None
):
download
=
zc
.
buildout
.
download
.
Download
(
self
.
buildout
[
'buildout'
],
download
=
zc
.
buildout
.
download
.
Download
(
self
.
buildout
[
'buildout'
],
...
@@ -309,7 +309,6 @@ class Script:
...
@@ -309,7 +309,6 @@ class Script:
def
install
(
self
):
def
install
(
self
):
try
:
try
:
env
=
self
.
getEnvironment
()
if
os
.
path
.
exists
(
self
.
options
[
'location'
]):
if
os
.
path
.
exists
(
self
.
options
[
'location'
]):
self
.
cleanup_dir_list
.
append
(
self
.
options
[
'location'
])
self
.
cleanup_dir_list
.
append
(
self
.
options
[
'location'
])
raise
shutil
.
Error
(
'Directory %s already exists'
%
raise
shutil
.
Error
(
'Directory %s already exists'
%
...
@@ -343,7 +342,6 @@ class Script:
...
@@ -343,7 +342,6 @@ class Script:
if
self
.
update_script
is
None
:
if
self
.
update_script
is
None
:
return
None
return
None
try
:
try
:
env
=
self
.
getEnvironment
()
exec
self
.
options
[
'update_script'
]
exec
self
.
options
[
'update_script'
]
try
:
try
:
self
.
_checkPromise
(
'slapos_update_promise'
,
self
.
options
[
'location'
])
self
.
_checkPromise
(
'slapos_update_promise'
,
self
.
options
[
'location'
])
...
...
slapos/recipe/build/tests.py
View file @
7dae0407
...
@@ -8,6 +8,8 @@ import stat
...
@@ -8,6 +8,8 @@ import stat
import
tempfile
import
tempfile
import
unittest
import
unittest
import
zc.buildout.testing
import
zc.buildout.testing
from
slapos.recipe.gitclone
import
GIT_CLONE_ERROR_MESSAGE
,
\
GIT_CLONE_CACHE_ERROR_MESSAGE
optionflags
=
(
doctest
.
ELLIPSIS
|
doctest
.
NORMALIZE_WHITESPACE
)
optionflags
=
(
doctest
.
ELLIPSIS
|
doctest
.
NORMALIZE_WHITESPACE
)
...
@@ -60,8 +62,6 @@ class GitCloneNonInformativeTests(unittest.TestCase):
...
@@ -60,8 +62,6 @@ class GitCloneNonInformativeTests(unittest.TestCase):
return
Recipe
(
bo
,
'test'
,
default_options
)
return
Recipe
(
bo
,
'test'
,
default_options
)
def
test_using_download_cache_if_git_fails
(
self
):
def
test_using_download_cache_if_git_fails
(
self
):
from
slapos.recipe.gitclone
import
GIT_CLONE_ERROR_MESSAGE
,
\
GIT_CLONE_CACHE_ERROR_MESSAGE
recipe
=
self
.
makeGitCloneRecipe
({
"use-cache"
:
"true"
,
recipe
=
self
.
makeGitCloneRecipe
({
"use-cache"
:
"true"
,
"repository"
:
BAD_GIT_REPOSITORY
})
"repository"
:
BAD_GIT_REPOSITORY
})
os
.
chdir
(
self
.
dir
)
os
.
chdir
(
self
.
dir
)
...
@@ -73,8 +73,6 @@ class GitCloneNonInformativeTests(unittest.TestCase):
...
@@ -73,8 +73,6 @@ class GitCloneNonInformativeTests(unittest.TestCase):
self
.
assertEquals
(
e
.
message
,
GIT_CLONE_CACHE_ERROR_MESSAGE
)
self
.
assertEquals
(
e
.
message
,
GIT_CLONE_CACHE_ERROR_MESSAGE
)
def
test_not_using_download_cache_if_forbidden
(
self
):
def
test_not_using_download_cache_if_forbidden
(
self
):
from
slapos.recipe.gitclone
import
GIT_CLONE_ERROR_MESSAGE
,
\
GIT_CLONE_ERROR_MESSAGE
recipe
=
self
.
makeGitCloneRecipe
({
"repository"
:
BAD_GIT_REPOSITORY
})
recipe
=
self
.
makeGitCloneRecipe
({
"repository"
:
BAD_GIT_REPOSITORY
})
os
.
chdir
(
self
.
dir
)
os
.
chdir
(
self
.
dir
)
try
:
try
:
...
@@ -99,8 +97,6 @@ class GitCloneNonInformativeTests(unittest.TestCase):
...
@@ -99,8 +97,6 @@ class GitCloneNonInformativeTests(unittest.TestCase):
self
.
assertFalse
(
os
.
path
.
exists
(
bad_file_path
),
"pyc file not removed"
)
self
.
assertFalse
(
os
.
path
.
exists
(
bad_file_path
),
"pyc file not removed"
)
def
test_ignore_ssl_certificate
(
self
,
ignore_ssl_certificate
=
True
):
def
test_ignore_ssl_certificate
(
self
,
ignore_ssl_certificate
=
True
):
from
slapos.recipe.gitclone
import
GIT_CLONE_ERROR_MESSAGE
,
\
GIT_CLONE_CACHE_ERROR_MESSAGE
import
slapos.recipe.gitclone
import
slapos.recipe.gitclone
# Monkey patch check_call
# Monkey patch check_call
...
...
slapos/recipe/gitclone.py
View file @
7dae0407
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#
#
##############################################################################
##############################################################################
import
errno
import
hashlib
import
hashlib
import
os
import
os
import
shutil
import
shutil
...
...
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