Closed huskercane closed 8 years ago
Scott thank you for the help.
did U fix the problem or U want me to make change?
Since I do not call any of this method
this is the code that runs into this error require 'softlayer_api' require 'pp'
@client = SoftLayer::Client.new packages = SoftLayer::ProductPackage.bare_metal_server_packages(@client)
package_ids = packages.map &:id # { |pacakge| pacakge.id }
File.open('/tmp/prices.txt', 'w') do |f| package_ids.each do |packageid| f.puts "\n============================" f.puts packageid f.puts '============================'
sl_bm_package = SoftLayer::ProductPackage.package_with_id(packageid, @client)
# Now we need to now what ProductItemCategories are required to
# configure a server in that package. This code prints out a table
# of the required category codes with a description of each
f.puts "\nRequired Categories for '#{sl_bm_package.name}':"
required_categories = sl_bm_package.configuration.select { |x| x.name.to_s.downcase == 'server' || x.name.to_s.downcase == 'ram' }
# puts required_categories.size()
# pp required_categories
required_categories.each do |category|
config_options = category.configuration_options
f.puts "\nConfiguration options in the '#{category.name}' category:"
config_options.each { |option| f.printf "%5s\t#{option.description}\n", option.price_id }
end
f.fsync
end end
code print out all packages and cpu/ram details
I apologize. I had responded while looking at an older version of the code. Then I realized my mistake and deleted my comment. Then I fixed the problem and released a 3.1.1 release with the fix. If you gem update softlayer_api, you should get the 3.1.1 build with the bug fix.
As always you are great
yep it did fix problem that I encountered. Thank you
Using softlayer_api (3.1.0)
NoMethodError: undefined method
capacity_restriction_maximum=' for #<SoftLayer::ProductConfigurationOption:0x0000000325b2c0> /home/rohits/.rvm/gems/ruby-2.2.1@global/gems/softlayer_api-3.1.0/lib/softlayer/ProductItemCategory.rb:40:in
initialize' /home/rohits/.rvm/gems/ruby-2.2.1@global/gems/softlayer_api-3.1.0/lib/softlayer/ProductItemCategory.rb:114:innew' /home/rohits/.rvm/gems/ruby-2.2.1@global/gems/softlayer_api-3.1.0/lib/softlayer/ProductItemCategory.rb:114:in
block (4 levels) in class:ProductItemCategory' /home/rohits/.rvm/gems/ruby-2.2.1@global/gems/softlayer_api-3.1.0/lib/softlayer/ProductItemCategory.rb:113:incollect' /home/rohits/.rvm/gems/ruby-2.2.1@global/gems/softlayer_api-3.1.0/lib/softlayer/ProductItemCategory.rb:113:in
block (3 levels) in class:ProductItemCategory' /home/rohits/.rvm/gems/ruby-2.2.1@global/gems/softlayer_api-3.1.0/lib/softlayer/ProductItemCategory.rb:112:incollect' /home/rohits/.rvm/gems/ruby-2.2.1@global/gems/softlayer_api-3.1.0/lib/softlayer/ProductItemCategory.rb:112:in
block (2 levels) in class:ProductItemCategory' /home/rohits/.rvm/gems/ruby-2.2.1@global/gems/softlayer_api-3.1.0/lib/softlayer/DynamicAttribute.rb:138:inblock in sl_dynamic_attr' /home/rohits/.rvm/gems/ruby-2.2.1@global/gems/softlayer_api-3.1.0/lib/softlayer/ProductItemCategory.rb:138:in
default_option' ./lib/sliwdautomation/esxi.rb:147:in `block in build_config_base'