Support firewalls based on NINC index, uuid, names
authorDimitris Aragiorgis <dimara@grnet.gr>
Fri, 22 Nov 2013 12:40:27 +0000 (14:40 +0200)
committerDimitris Aragiorgis <dimara@grnet.gr>
Sat, 7 Dec 2013 14:25:01 +0000 (16:25 +0200)
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

common.sh

index 3cc2fa5..d9c127e 100755 (executable)
--- a/common.sh
+++ b/common.sh
@@ -81,9 +81,15 @@ function routed_setup_ipv6 {
 
 # pick a firewall profile per NIC, based on tags (and apply it)
 function routed_setup_firewall {
-       ifprefix="synnefo:network:$INTERFACE_INDEX:"
+       # for latest ganeti there is no need to check other but uuid
+       ifprefixindex="synnefo:network:$INTERFACE_INDEX:"
+       ifprefixname="synnefo:network:$INTERFACE_NAME:"
+       ifprefixuuid="synnefo:network:$INTERFACE_UUID:"
        for tag in $TAGS; do
-               case ${tag#$ifprefix} in
+               tag=${tag#$ifprefixindex}
+               tag=${tag#$ifprefixname}
+               tag=${tag#$ifprefixuuid}
+               case $tag in
                protected)
                        chain=protected
                ;;