up version after release
Change-Id: I6120736c0aeddac9417ad9cd26420b6823bd81d7
This commit is contained in:
parent
dbed9503af
commit
483fd881cf
|
@ -18,3 +18,4 @@ dist
|
|||
.coverage*
|
||||
!.coveragerc
|
||||
cover/
|
||||
ec2api/tests/unit/test_cert.pem
|
||||
|
|
|
@ -36,23 +36,30 @@ fi
|
|||
EC2_URL=`openstack endpoint list --service ec2 --interface public --os-identity-api-version=3 -c URL -f value`
|
||||
S3_URL=`openstack endpoint list --service s3 --interface public --os-identity-api-version=3 -c URL -f value`
|
||||
|
||||
# in some cases these packages can present in the system but don't work
|
||||
# reinstalling can help
|
||||
venv_dir="$(pwd)/.venv_awscli"
|
||||
virtualenv "$venv_dir"
|
||||
if [[ "$?" -ne "0" ]]; then
|
||||
die $LINENO "Can't setup virtual env."
|
||||
fi
|
||||
source "$venv_dir/bin/activate"
|
||||
pip install awscli
|
||||
if [[ "$?" -ne "0" ]]; then
|
||||
die $LINENO "Can't install awscli in virtual env."
|
||||
fi
|
||||
aws --version
|
||||
if [[ "$?" -ne "0" ]]; then
|
||||
sudo pip install awscli --upgrade
|
||||
aws --version
|
||||
if [[ "$?" -ne "0" ]]; then
|
||||
die $LINENO "Looks like awscli is not correctly installed."
|
||||
fi
|
||||
die $LINENO "awscli doesn't work correctly."
|
||||
fi
|
||||
deactivate
|
||||
|
||||
project_id=`openstack project show $OS_PROJECT_NAME -c id -f value`
|
||||
openstack ec2 credentials create 1>&2
|
||||
line=`openstack ec2 credentials list | grep " $project_id "`
|
||||
read ec2_access_key ec2_secret_key <<< `echo $line | awk '{print $2 " " $4 }'`
|
||||
source "$venv_dir/bin/activate"
|
||||
aws configure set aws_access_key_id $ec2_access_key --profile admin
|
||||
aws configure set aws_secret_access_key $ec2_secret_key --profile admin
|
||||
deactivate
|
||||
AWS_PARAMS="--region $REGION_NAME --endpoint-url $EC2_URL"
|
||||
|
||||
neutron_item=$(openstack service list | grep neutron)
|
||||
|
@ -67,7 +74,9 @@ wget -nv -P /tmp $CIRROS_IMAGE_URL &
|
|||
cirros_image_wget_pid=$!
|
||||
|
||||
# find simple image
|
||||
source "$venv_dir/bin/activate"
|
||||
image_id=`aws $AWS_PARAMS --profile admin ec2 describe-images --filters Name=image-type,Values=machine Name=name,Values=cirros* --query 'Images[0].ImageId' --output text`
|
||||
deactivate
|
||||
|
||||
# prepare ubuntu image
|
||||
if [[ $RUN_LONG_TESTS == "1" ]]; then
|
||||
|
@ -83,7 +92,9 @@ if [[ $RUN_LONG_TESTS == "1" ]]; then
|
|||
exit 1
|
||||
fi
|
||||
# find this image
|
||||
source "$venv_dir/bin/activate"
|
||||
image_id_ubuntu=`aws $AWS_PARAMS --profile admin ec2 describe-images --filters Name=image-type,Values=machine Name=name,Values=$REGULAR_IMAGE_NAME --query 'Images[0].ImageId' --output text`
|
||||
deactivate
|
||||
fi
|
||||
|
||||
# create separate user/project
|
||||
|
@ -117,8 +128,10 @@ fi
|
|||
openstack ec2 credentials create --user $user_id --project $project_id 1>&2
|
||||
line=`openstack ec2 credentials list --user $user_id | grep " $project_id "`
|
||||
read ec2_access_key ec2_secret_key <<< `echo $line | awk '{print $2 " " $4 }'`
|
||||
source "$venv_dir/bin/activate"
|
||||
aws configure set aws_access_key_id $ec2_access_key --profile user
|
||||
aws configure set aws_secret_access_key $ec2_secret_key --profile user
|
||||
deactivate
|
||||
|
||||
auth="--os-project-name $project_name --os-username $user_name --os-password password"
|
||||
|
||||
|
@ -177,7 +190,9 @@ if [[ -n "$openstack_image_id" ]]; then
|
|||
if [[ "$?" -ne "0" ]]; then
|
||||
die $LINENO "Image creation from instance fails"
|
||||
fi
|
||||
source "$venv_dir/bin/activate"
|
||||
ebs_image_id=`aws $AWS_PARAMS --profile user ec2 describe-images --filters Name=image-type,Values=machine Name=name,Values=$image_name --query 'Images[0].ImageId' --output text`
|
||||
deactivate
|
||||
nova $auth delete $instance_id
|
||||
fi
|
||||
|
||||
|
@ -196,6 +211,7 @@ fi
|
|||
|
||||
wait $cirros_image_wget_pid
|
||||
if [[ "$?" -eq "0" ]]; then
|
||||
sudo apt-get -fy install ruby
|
||||
ID="$(cat /dev/urandom | tr -cd 'a-f0-9' | head -c 8)"
|
||||
WORKING_DIR="/tmp/bi-$ID"
|
||||
mkdir -p $WORKING_DIR
|
||||
|
@ -228,7 +244,9 @@ if [[ "$?" -eq "0" ]]; then
|
|||
warn $LINENO "Bundling of image $CIRROS_IMAGE_URL failed."
|
||||
fi
|
||||
# next line is example how to register this image in the cloud
|
||||
#source "$venv_dir/bin/activate"
|
||||
#aws --endpoint-url $EC2_URL --region RegionOne --profile admin ec2 register-image --image-location "$AWS_AMI_BUCKET/$CIRROS_IMAGE_FNAME.manifest.xml" --name "$CIRROS_IMAGE_FNAME" --architecture x86_64
|
||||
#deactivate
|
||||
else
|
||||
warn $LINENO "Downloading of image $CIRROS_IMAGE_URL failed."
|
||||
fi
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[metadata]
|
||||
name = ec2-api
|
||||
version = 4.0.1
|
||||
version = 4.0.2
|
||||
summary = OpenStack Ec2api Service
|
||||
description-file =
|
||||
README.rst
|
||||
|
|
2
tox.ini
2
tox.ini
|
@ -6,7 +6,7 @@ skipsdist = True
|
|||
[testenv]
|
||||
sitepackages = False
|
||||
usedevelop = True
|
||||
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
||||
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata} {opts} {packages}
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
BRANCH_NAME=master
|
||||
CLIENT_NAME=ec2-api
|
||||
|
|
Loading…
Reference in New Issue