Skip to content

Commit 3e3104f

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Define extra_elements inside disk_image_create_upload"
2 parents b702750 + 8874115 commit 3e3104f

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

lib/dib

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ OCC_DIR=$DEST/os-collect-config
3535
ORC_DIR=$DEST/os-refresh-config
3636
OAC_DIR=$DEST/os-apply-config
3737

38-
# Include the apt-sources element in builds if we have an
39-
# alternative sources.list specified.
40-
if [ -n "$DIB_APT_SOURCES" ]; then
41-
if [ ! -e "$DIB_APT_SOURCES" ]; then
42-
die $LINENO "DIB_APT_SOURCES set but not found at $DIB_APT_SOURCES"
43-
fi
44-
EXTRA_ELEMENTS="apt-sources"
45-
fi
46-
4738
# Functions
4839
# ---------
4940

@@ -106,6 +97,15 @@ function disk_image_create_upload {
10697

10798
local image_path=$TOP_DIR/files/$image_name.qcow2
10899

100+
# Include the apt-sources element in builds if we have an
101+
# alternative sources.list specified.
102+
if [ -n "$DIB_APT_SOURCES" ]; then
103+
if [ ! -e "$DIB_APT_SOURCES" ]; then
104+
die $LINENO "DIB_APT_SOURCES set but not found at $DIB_APT_SOURCES"
105+
fi
106+
local extra_elements="apt-sources"
107+
fi
108+
109109
# Set the local pip repo as the primary index mirror so the
110110
# image is built with local packages
111111
local pypi_mirror_url=http://$SERVICE_HOST:$DIB_PIP_REPO_PORT/
@@ -127,7 +127,7 @@ function disk_image_create_upload {
127127
DIB_OFFLINE=$DIB_BUILD_OFFLINE \
128128
PYPI_MIRROR_URL=$pypi_mirror_url \
129129
PYPI_MIRROR_URL_1=$pypi_mirror_url_1 \
130-
disk-image-create -a amd64 $image_elements $EXTRA_ELEMENTS \
130+
disk-image-create -a amd64 $image_elements ${extra_elements:-} \
131131
--image-cache $DIB_IMAGE_CACHE \
132132
-o $image_path
133133

0 commit comments

Comments
 (0)