← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1258369] [NEW] refactor showcommand and RetrievePoolStats

 

Public bug reported:

RetrievePoolStats is copying code because the id query and returned data
are using different resource name.

    def get_data(self, parsed_args):
        self.log.debug('run(%s)' % parsed_args)
        neutron_client = self.get_client()
        neutron_client.format = parsed_args.request_format
        pool_id = neutronV20.find_resourceid_by_name_or_id(
            self.get_client(), 'pool', parsed_args.id)
        params = {}
        if parsed_args.fields:
            params = {'fields': parsed_args.fields}

        data = neutron_client.retrieve_pool_stats(pool_id, **params)
        self.format_output_data(data)
        stats = data['stats']
        if 'stats' in data:
            return zip(*sorted(stats.iteritems()))
        else:
            return None

** Affects: python-neutronclient
     Importance: Medium
     Assignee: yong sheng gong (gongysh)
         Status: In Progress

** Project changed: neutron => python-neutronclient

** Changed in: python-neutronclient
     Assignee: (unassigned) => yong sheng gong (gongysh)

** Changed in: python-neutronclient
   Importance: Undecided => Medium

** Changed in: python-neutronclient
    Milestone: None => 2.2.1

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

Title:
  refactor showcommand and RetrievePoolStats

Status in Python client library for Neutron:
  In Progress

Bug description:
  RetrievePoolStats is copying code because the id query and returned
  data are using different resource name.

      def get_data(self, parsed_args):
          self.log.debug('run(%s)' % parsed_args)
          neutron_client = self.get_client()
          neutron_client.format = parsed_args.request_format
          pool_id = neutronV20.find_resourceid_by_name_or_id(
              self.get_client(), 'pool', parsed_args.id)
          params = {}
          if parsed_args.fields:
              params = {'fields': parsed_args.fields}

          data = neutron_client.retrieve_pool_stats(pool_id, **params)
          self.format_output_data(data)
          stats = data['stats']
          if 'stats' in data:
              return zip(*sorted(stats.iteritems()))
          else:
              return None

To manage notifications about this bug go to:
https://bugs.launchpad.net/python-neutronclient/+bug/1258369/+subscriptions


Follow ups

References