From bac2e4ddc28393fbd3c6f45248737893b5d0fd97 Mon Sep 17 00:00:00 2001 From: Carlos Goncalves Date: Fri, 11 Nov 2016 15:02:57 +0100 Subject: [PATCH] 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 --- samples/local.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/local.sh b/samples/local.sh index 634f6ddb17..9cd0bdcc17 100755 --- a/samples/local.sh +++ b/samples/local.sh @@ -36,7 +36,7 @@ if is_service_enabled nova; then # Add first keypair found in localhost:$HOME/.ssh for i in $HOME/.ssh/id_rsa.pub $HOME/.ssh/id_dsa.pub; do if [[ -r $i ]]; then - nova keypair-add --pub_key=$i `hostname` + openstack keypair create --public-key $i `hostname` break fi done @@ -53,8 +53,8 @@ if is_service_enabled nova; then MI_NAME=m1.micro # Create micro flavor if not present - if [[ -z $(nova flavor-list | grep $MI_NAME) ]]; then - nova flavor-create $MI_NAME 6 128 0 1 + if [[ -z $(openstack flavor list | grep $MI_NAME) ]]; then + openstack flavor create $MI_NAME --id 6 --ram 128 --disk 0 --vcpus 1 fi @@ -62,7 +62,7 @@ if is_service_enabled nova; then # ---------- # Add tcp/22 and icmp to default security group - nova secgroup-add-rule default tcp 22 22 0.0.0.0/0 - nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0 + openstack security group rule create --project $OS_PROJECT_NAME default --protocol tcp --ingress --dst-port 22 + openstack security group rule create --project $OS_PROJECT_NAME default --protocol icmp fi