Update local.sh sample file to use OSC

Besides updating to OSC CLI, this patch also fixes an argument name typo
present before in 'nova keypair-add' (--pub_key should be --pub-key).

Specifying $OS_PROJECT_NAME in case user is associated to multiple
projects containing security groups with same name (e.g. 'default').

Change-Id: I776f6edfc4c6c798a39d3260827a18c695f05c87
This commit is contained in:
Carlos Goncalves 2016-11-11 15:02:57 +01:00
parent 319abcaf85
commit bac2e4ddc2

View File

@ -36,7 +36,7 @@ if is_service_enabled nova; then
# Add first keypair found in localhost:$HOME/.ssh # Add first keypair found in localhost:$HOME/.ssh
for i in $HOME/.ssh/id_rsa.pub $HOME/.ssh/id_dsa.pub; do for i in $HOME/.ssh/id_rsa.pub $HOME/.ssh/id_dsa.pub; do
if [[ -r $i ]]; then if [[ -r $i ]]; then
nova keypair-add --pub_key=$i `hostname` openstack keypair create --public-key $i `hostname`
break break
fi fi
done done
@ -53,8 +53,8 @@ if is_service_enabled nova; then
MI_NAME=m1.micro MI_NAME=m1.micro
# Create micro flavor if not present # Create micro flavor if not present
if [[ -z $(nova flavor-list | grep $MI_NAME) ]]; then if [[ -z $(openstack flavor list | grep $MI_NAME) ]]; then
nova flavor-create $MI_NAME 6 128 0 1 openstack flavor create $MI_NAME --id 6 --ram 128 --disk 0 --vcpus 1
fi fi
@ -62,7 +62,7 @@ if is_service_enabled nova; then
# ---------- # ----------
# Add tcp/22 and icmp to default security group # Add tcp/22 and icmp to default security group
nova secgroup-add-rule default tcp 22 22 0.0.0.0/0 openstack security group rule create --project $OS_PROJECT_NAME default --protocol tcp --ingress --dst-port 22
nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0 openstack security group rule create --project $OS_PROJECT_NAME default --protocol icmp
fi fi