From 60fab05135d128c217392e102a90546b3cfdf45a Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 16 Sep 2015 12:10:55 -0400 Subject: [PATCH] MT#15237 Generate list of RTP interfaces from all configured hosts Change-Id: Ia1476b800983ab84a92860e68c955a2ab42527b8 (cherry picked from commit 776a4da7b3e7f0572adf5789a6cbd300105f9c9b) --- lib/get_all_rtp_interfaces | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/get_all_rtp_interfaces diff --git a/lib/get_all_rtp_interfaces b/lib/get_all_rtp_interfaces new file mode 100644 index 00000000..6714d4eb --- /dev/null +++ b/lib/get_all_rtp_interfaces @@ -0,0 +1,32 @@ +[% + + # Returns a list of RTP-enabled interfaces from all hosts + # + # @return out The array of interfaces + +X_out = { }; + +FOREACH X_host IN hosts.keys; + X_hd = hosts.$X_host; + X_roles = X_hd.role; + IF X_roles.grep('^rtp$').size() == 0; + NEXT; + END; + + FOREACH X_iface IN X_hd.interfaces; + X_if = X_hd.$X_iface; + X_types = X_if.type; + X_tgl = X_types.grep('^rtp_.'); + IF X.tgl.size() == 0; + NEXT; + END; + + X_type = X_tgl.0; + X_type = X_type.remove('^rtp_'); + X_out.$X_type = 1; + END; +END; + +X_vals = X_out.keys; +out = X_vals.sort; +-%]