From 951e14d6dd534236e2710a48fb3d86d66f5c0228 Mon Sep 17 00:00:00 2001 From: Bharat Kunwar Date: Thu, 8 Aug 2019 16:20:19 +0000 Subject: [PATCH] Fix default security group in samples/local.sh The script currently complains about multiple default security groups. This obtains the default and uses it when creating security group rules. Change-Id: I81e59eae5df79889ed1fb02d45af26e3a55aa0e9 --- samples/local.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/samples/local.sh b/samples/local.sh index 9cd0bdcc17..a1c5c8143b 100755 --- a/samples/local.sh +++ b/samples/local.sh @@ -41,6 +41,13 @@ if is_service_enabled nova; then fi done + # Update security default group + # ----------------------------- + + # Add tcp/22 and icmp to default security group + default=$(openstack security group list -f value -c ID) + openstack security group rule create $default --protocol tcp --dst-port 22 + openstack security group rule create $default --protocol icmp # Create A Flavor # --------------- @@ -57,12 +64,4 @@ if is_service_enabled nova; then openstack flavor create $MI_NAME --id 6 --ram 128 --disk 0 --vcpus 1 fi - - # Other Uses - # ---------- - - # Add tcp/22 and icmp to default security group - 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