Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kolla Ansible
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kolla Ansible
Commits
ecfc955a
Commit
ecfc955a
authored
9 years ago
by
Jenkins
Committed by
Gerrit Code Review
9 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Fix the kolla to find the docker image folder in virtualenv"
parents
ff8ff410
e32f5c52
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kolla/cmd/build.py
+18
-25
18 additions, 25 deletions
kolla/cmd/build.py
with
18 additions
and
25 deletions
kolla/cmd/build.py
+
18
−
25
View file @
ecfc955a
...
@@ -20,7 +20,6 @@ import graphviz
...
@@ -20,7 +20,6 @@ import graphviz
import
json
import
json
import
logging
import
logging
import
os
import
os
import
platform
import
re
import
re
import
requests
import
requests
import
shutil
import
shutil
...
@@ -48,6 +47,9 @@ LOG.setLevel(logging.INFO)
...
@@ -48,6 +47,9 @@ LOG.setLevel(logging.INFO)
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_DFL
)
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_DFL
)
PROJECT_ROOT
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
'
../..
'
))
class
KollaDirNotFoundException
(
Exception
):
class
KollaDirNotFoundException
(
Exception
):
pass
pass
...
@@ -277,34 +279,11 @@ class WorkerThread(Thread):
...
@@ -277,34 +279,11 @@ class WorkerThread(Thread):
self
.
push_queue
.
put
(
image
)
self
.
push_queue
.
put
(
image
)
def
find_os_type
():
return
platform
.
linux_distribution
()
def
find_base_dir
():
script_path
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
sys
.
argv
[
0
]))
if
os
.
path
.
basename
(
script_path
)
==
'
cmd
'
:
return
os
.
path
.
realpath
(
os
.
path
.
join
(
script_path
,
'
..
'
,
'
..
'
))
if
os
.
path
.
basename
(
script_path
)
==
'
bin
'
:
if
find_os_type
()[
0
]
in
[
'
Ubuntu
'
,
'
debian
'
]:
return
'
/usr/local/share/kolla
'
else
:
return
'
/usr/share/kolla
'
if
os
.
path
.
exists
(
os
.
path
.
join
(
script_path
,
'
tests
'
)):
return
script_path
raise
KollaDirNotFoundException
(
'
I do not know where your Kolla directory is
'
)
class
KollaWorker
(
object
):
class
KollaWorker
(
object
):
def
__init__
(
self
,
conf
):
def
__init__
(
self
,
conf
):
self
.
conf
=
conf
self
.
conf
=
conf
self
.
base_dir
=
os
.
path
.
abspath
(
find_base_dir
())
self
.
images_dir
=
self
.
_get_images_dir
()
LOG
.
debug
(
"
Kolla base directory:
"
+
self
.
base_dir
)
self
.
images_dir
=
os
.
path
.
join
(
self
.
base_dir
,
'
docker
'
)
self
.
registry
=
conf
.
registry
self
.
registry
=
conf
.
registry
if
self
.
registry
:
if
self
.
registry
:
self
.
namespace
=
self
.
registry
+
'
/
'
+
conf
.
namespace
self
.
namespace
=
self
.
registry
+
'
/
'
+
conf
.
namespace
...
@@ -343,6 +322,20 @@ class KollaWorker(object):
...
@@ -343,6 +322,20 @@ class KollaWorker(object):
self
.
image_statuses_unmatched
=
dict
()
self
.
image_statuses_unmatched
=
dict
()
self
.
maintainer
=
conf
.
maintainer
self
.
maintainer
=
conf
.
maintainer
def
_get_images_dir
(
self
):
possible_paths
=
(
PROJECT_ROOT
,
os
.
path
.
join
(
sys
.
prefix
,
'
share/kolla
'
),
os
.
path
.
join
(
sys
.
prefix
,
'
local/share/kolla
'
))
for
path
in
possible_paths
:
image_path
=
os
.
path
.
join
(
path
,
'
docker
'
)
if
os
.
path
.
exists
(
image_path
):
LOG
.
info
(
'
Found the docker image folder at %s
'
,
image_path
)
return
image_path
else
:
raise
KollaDirNotFoundException
(
'
Image dir can not be found
'
)
def
build_rpm_setup
(
self
,
rpm_setup_config
):
def
build_rpm_setup
(
self
,
rpm_setup_config
):
"""
Generates a list of docker commands based on provided configuration.
"""
Generates a list of docker commands based on provided configuration.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment