<commit_before>module HP
  module Cloud
    class CLI < Thor

      map 'volumes:servers' => 'volumes:server'

      desc "volumes:server [server]", "List the volumes on server."
      long_desc <<-DESC
  List the volumes attached to servers with the device they are using.  Optionally, you may filter by specifying the server name or ID on the command line.

Examples:
  hpcloud volumes:server                                 # List all the attached volumes:
  hpcloud volumes:server myServer                        # List the volumes on server `myServer`:
  hpcloud volumes:server myServer -z az-2.region-a.geo-1 # List the volumes on server `myServer` for availability zone `az-2.region-a.geo-1`:
      DESC
      CLI.add_common_options
      define_method "volumes:server" do |*arguments|
        cli_command(options) {
          rayray = []
          servers = Servers.new.get(arguments)
          servers.each { |server|
            if server.is_valid? == false
              @log.error server.cstatus
              next
            end
            ray = VolumeAttachments.new(server).get_array()
            if ray.nil?
              @log.error "Cannot find any volumes for '#{server.name}'.", :not_found
              next
            end
            rayray += ray
          }
          if rayray.empty? == false
            Tableizer.new(options, VolumeAttachment.get_keys(), rayray).print
          end
        }
      end
    end
  end
end<commit_msg>dxcli-353 fix volumes:server message if nothing attached<commit_after>module HP
  module Cloud
    class CLI < Thor

      map 'volumes:servers' => 'volumes:server'

      desc "volumes:server [server]", "List the volumes on server."
      long_desc <<-DESC
  List the volumes attached to servers with the device they are using.  Optionally, you may filter by specifying the server name or ID on the command line.

Examples:
  hpcloud volumes:server                                 # List all the attached volumes:
  hpcloud volumes:server myServer                        # List the volumes on server `myServer`:
  hpcloud volumes:server myServer -z az-2.region-a.geo-1 # List the volumes on server `myServer` for availability zone `az-2.region-a.geo-1`:
      DESC
      CLI.add_common_options
      define_method "volumes:server" do |*arguments|
        cli_command(options) {
          rayray = []
          servers = Servers.new.get(arguments)
          servers.each { |server|
            if server.is_valid? == false
              @log.error server.cstatus
              next
            end
            ray = VolumeAttachments.new(server).get_array()
            if ray.empty?
              @log.error "Cannot find any volumes for '#{server.name}'.", :not_found
              next
            end
            rayray += ray
          }
          if rayray.empty? == false
            Tableizer.new(options, VolumeAttachment.get_keys(), rayray).print
          end
        }
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08285618053216572, 'fraction_numerical': 0.00370495116200741, 'mean_word_length': 1.894736842105263, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1442983', 'n_tokens_mistral': 814, 'n_tokens_neox': 791, 'n_words': 257}