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
eb0d0cdc
Commit
eb0d0cdc
authored
9 years ago
by
Michal Rostecki
Browse files
Options
Downloads
Patches
Plain Diff
Add Python 3.x support
Implements: blueprint python3 Change-Id: I1e02568907aa38dd0efcb428235004ce47d73af8
parent
ac0442a8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
kolla/cmd/build.py
+11
-12
11 additions, 12 deletions
kolla/cmd/build.py
requirements.txt
+1
-0
1 addition, 0 deletions
requirements.txt
tests/test_build.py
+2
-1
2 additions, 1 deletion
tests/test_build.py
with
14 additions
and
13 deletions
kolla/cmd/build.py
+
11
−
12
View file @
eb0d0cdc
...
...
@@ -15,13 +15,11 @@
# TODO(jpeeler): Add clean up handler for SIGINT
import
argparse
import
ConfigParser
import
datetime
import
json
import
logging
import
os
import
platform
import
Queue
import
re
import
requests
import
shutil
...
...
@@ -36,6 +34,7 @@ import docker
import
git
import
jinja2
from
requests.exceptions
import
ConnectionError
import
six
logging
.
basicConfig
()
LOG
=
logging
.
getLogger
(
__name__
)
...
...
@@ -168,7 +167,7 @@ class WorkerThread(Thread):
rm
=
True
,
pull
=
pull
,
forcerm
=
self
.
forcerm
):
stream
=
json
.
loads
(
response
)
stream
=
json
.
loads
(
response
.
decode
(
'
utf-8
'
)
)
if
'
stream
'
in
stream
:
image
[
'
logs
'
]
=
image
[
'
logs
'
]
+
stream
[
'
stream
'
]
...
...
@@ -348,7 +347,7 @@ class KollaWorker(object):
self
.
include_footer
=
config
[
'
include_footer
'
]
self
.
regex
=
config
[
'
regex
'
]
self
.
profile
=
config
[
'
profile
'
]
self
.
source_location
=
C
onfig
P
arser
.
SafeConfigParser
()
self
.
source_location
=
six
.
moves
.
c
onfig
p
arser
.
SafeConfigParser
()
self
.
source_location
.
read
(
find_config_file
(
'
kolla-build.conf
'
))
self
.
image_statuses_bad
=
dict
()
self
.
image_statuses_good
=
dict
()
...
...
@@ -423,10 +422,10 @@ class KollaWorker(object):
filter_
+=
self
.
source_location
.
get
(
'
profiles
'
,
profile
).
split
(
'
,
'
)
except
C
onfig
P
arser
.
NoSectionError
:
except
six
.
moves
.
c
onfig
p
arser
.
NoSectionError
:
LOG
.
error
(
'
No [profiles] section found in {}
'
.
format
(
find_config_file
(
'
kolla-build.conf
'
)))
except
C
onfig
P
arser
.
NoOptionError
:
except
six
.
moves
.
c
onfig
p
arser
.
NoOptionError
:
LOG
.
error
(
'
No profile named
"
{}
"
found in {}
'
.
format
(
self
.
profile
,
find_config_file
(
'
kolla-build.conf
'
)))
...
...
@@ -472,7 +471,7 @@ class KollaWorker(object):
if
self
.
image_statuses_bad
:
LOG
.
info
(
"
Images that failed to build
"
)
LOG
.
info
(
"
===========================
"
)
for
name
,
status
in
self
.
image_statuses_bad
.
iteritems
(
):
for
name
,
status
in
six
.
iteritems
(
self
.
image_statuses_bad
):
LOG
.
error
(
'
{}
\r\t\t\t
Failed with status: {}
'
.
format
(
name
,
status
))
...
...
@@ -529,7 +528,7 @@ class KollaWorker(object):
self
.
source_location
.
get
(
image
[
'
name
'
],
'
reference
'
)
except
C
onfig
P
arser
.
NoSectionError
:
except
six
.
moves
.
c
onfig
p
arser
.
NoSectionError
:
LOG
.
debug
(
'
{}:No source location found
'
.
format
(
image
[
'
name
'
]))
pass
...
...
@@ -543,7 +542,7 @@ class KollaWorker(object):
for
image
in
self
.
images
:
sort_images
[
image
[
'
fullname
'
]]
=
image
for
parent_name
,
parent
in
s
ort_images
.
iteritems
():
for
parent_name
,
parent
in
s
ix
.
iteritems
(
sort_images
):
for
image
in
sort_images
.
values
():
if
image
[
'
parent_name
'
]
==
parent_name
:
parent
[
'
children
'
].
append
(
image
)
...
...
@@ -559,7 +558,7 @@ class KollaWorker(object):
self
.
find_parents
()
self
.
filter_images
()
queue
=
Q
ueue
.
Queue
()
queue
=
six
.
moves
.
q
ueue
.
Queue
()
for
image
in
self
.
images
:
if
image
[
'
parent
'
]
is
None
:
...
...
@@ -587,7 +586,7 @@ def push_image(image):
def
main
():
build_config
=
C
onfig
P
arser
.
SafeConfigParser
()
build_config
=
six
.
moves
.
c
onfig
p
arser
.
SafeConfigParser
()
build_config
.
read
(
find_config_file
(
'
kolla-build.conf
'
))
config
=
merge_args_and_config
(
build_config
)
if
config
[
'
debug
'
]:
...
...
@@ -608,7 +607,7 @@ def main():
queue
=
kolla
.
build_queue
()
for
x
in
xrange
(
config
[
'
threads
'
]):
for
x
in
six
.
moves
.
xrange
(
config
[
'
threads
'
]):
worker
=
WorkerThread
(
queue
,
config
)
worker
.
setDaemon
(
True
)
worker
.
start
()
...
...
This diff is collapsed.
Click to expand it.
requirements.txt
+
1
−
0
View file @
eb0d0cdc
...
...
@@ -6,3 +6,4 @@ docker-py>=1.4.0 # Apache-2.0
Jinja2
>=2.6 # BSD License (3 clause)
gitdb
>=0.6.4 # BSD License (3 clause)
GitPython
>=1.0.1 # BSD License (3 clause)
six
>=1.9.0
This diff is collapsed.
Click to expand it.
tests/test_build.py
+
2
−
1
View file @
eb0d0cdc
...
...
@@ -16,6 +16,7 @@ from os import path
from
oslo_log
import
fixture
as
log_fixture
from
oslo_log
import
log
as
logging
from
oslotest
import
base
import
six
import
sys
sys
.
path
.
append
(
path
.
abspath
(
path
.
join
(
path
.
dirname
(
__file__
),
'
../tools
'
)))
...
...
@@ -44,7 +45,7 @@ class BuildTest(base.BaseTestCase):
"
ironic-discoverd
"
]
failures
=
0
for
image
,
result
in
bad_results
.
iteritems
(
):
for
image
,
result
in
six
.
iteritems
(
bad_results
):
if
image
in
excluded_images
:
if
result
is
'
error
'
:
continue
...
...
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