def metadata_accept():
 rule = ('-p tcp -m tcp --dport %s %s -j ACCEPT' % (CONF.metadata_port, _iptables_dest(CONF.metadata_host)))
 if (netaddr.IPAddress(CONF.metadata_host).version == 4):
  iptables_manager.ipv4['filter'].add_rule('INPUT', rule)
 else:
  iptables_manager.ipv6['filter'].add_rule('INPUT', rule)
 iptables_manager.apply()

def metadata_accept ( ) : rule = ( '-p tcp -m tcp --dport %s %s -j ACCEPT' % ( CONF . metadata_port , _iptables_dest ( CONF . metadata_host ) ) ) if ( netaddr . IPAddress ( CONF . metadata_host ) . version == 4 ) : iptables_manager . ipv4 [ 'filter' ] . add_rule ( 'INPUT' , rule ) else : iptables_manager . ipv6 [ 'filter' ] . add_rule ( 'INPUT' , rule ) iptables_manager . apply ( )
create the filter accept rule for metadata .