← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1248002] Re: bandwidth metering - excluded option doesn't work

 

** Changed in: neutron
       Status: Fix Committed => Fix Released

** Changed in: neutron
    Milestone: None => icehouse-2

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1248002

Title:
  bandwidth metering - excluded option doesn't work

Status in OpenStack Neutron (virtual network service):
  Fix Released

Bug description:
  When I using 'meter-label-rule-create' command with neutronclient, excluded option is doesn't work.
  The option exclude this cidr from the label.
  You have to fix below code:
  neutron / neutron / services / metering / drivers / iptables / iptables_driver.py
  (line number is 157)

  def _process_metering_label_rules(self, rm, rules, label_chain,
                                        rules_chain):
          im = rm.iptables_manager
          ext_dev = self.get_external_device_name(rm.router['gw_port_id'])
          if not ext_dev:
              return

          for rule in rules:
              remote_ip = rule['remote_ip_prefix']

              dir = '-i ' + ext_dev
              if rule['direction'] == 'egress':
                  dir = '-o ' + ext_dev

              if rule['excluded'] == 'true':   ------> fix it : True (boolean type)
                  ipt_rule = dir + ' -d ' + remote_ip + ' -j RETURN'
                  im.ipv4['filter'].add_rule(rules_chain, ipt_rule, wrap=False,
                                             top=True)
              else:
                  ipt_rule = dir + ' -d ' + remote_ip + ' -j ' + label_chain
                  im.ipv4['filter'].add_rule(rules_chain, ipt_rule,
                                             wrap=False, top=False)

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1248002/+subscriptions