danarchy_sys 0.4.1 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b1e094ad82f2d002063b01c037957cbfd6e915f
4
- data.tar.gz: 55b06fbcd0d476ea85df5a058680d2806c03c295
3
+ metadata.gz: 91467380d7fc7465187c4929c8421828cb7d1343
4
+ data.tar.gz: c97f5d4a0b6ad94e05a2e7758b8f525f8184d2ee
5
5
  SHA512:
6
- metadata.gz: 3409e3db49b0d56cd2ed32d269ba41f775d04c47adedcfc6d24411bc88f609b6e4fedeb3292ccc2f22c700854a727159e0ed4719f1bb1d9ca7db90f52a9836a4
7
- data.tar.gz: 0c24575f54b573901d98712b758507d8689a65d698e326bb759da25b37acf65dbb4d1dde6e4735bb12622984829dc7987ccaaa7a6dd43532f99e264a0ed1435a
6
+ metadata.gz: 09f9b084eba3b008aacd25310afe55d2a298ac8113649bd1224689be72418cfc5bc79674fd8f3685dc85f8e76d916cdc4d85073324e102744f4ecf1702adbada
7
+ data.tar.gz: be506fe3640af9e886ccc951bc8067dbb0f89b858ebaaa1bdbce4a0ee85b7c27c0ef222a575835c06c88dc8c6b242bf4c3f703704c23ccd512042aeca99ccfd2
@@ -62,14 +62,14 @@ class PromptsCreateInstance
62
62
  end
63
63
 
64
64
  def self.image(comp_imgs)
65
- images_numbered = Helpers.objects_to_numhash(comp_imgs.all_images({'status' => 'ACTIVE'}))
65
+ images_numbered = Helpers.array_to_numhash(comp_imgs.all_images)
66
66
 
67
67
  # List available images in a numbered hash.
68
68
  puts "\nAvailable Images:"
69
- i_name_length = images_numbered.values.collect{|i| i[:name]}.max.size
69
+ i_name_length = images_numbered.values.collect{|i| i.name}.max.size
70
70
  printf("%0s %-#{i_name_length}s\n", 'Id', 'Image')
71
71
  images_numbered.each do |id, image|
72
- printf("%0s %-#{i_name_length}s\n", "#{id}.", image[:name])
72
+ printf("%0s %-#{i_name_length}s\n", "#{id}.", image.name)
73
73
  end
74
74
 
75
75
  image_name = item_chooser(images_numbered, 'image')
@@ -78,19 +78,19 @@ class PromptsCreateInstance
78
78
  end
79
79
 
80
80
  def self.flavor(comp_flvs)
81
- flavors_numbered = Helpers.objects_to_numhash(comp_flvs.all_flavors.sort_by(&:ram))
82
- flavor_name = nil
81
+ flavors_numbered = Helpers.array_to_numhash(comp_flvs.all_flavors.sort_by(&:ram))
83
82
 
84
83
  puts "\nAvailable Instance Flavors:"
85
84
  puts sprintf("%0s %-15s %-10s %-10s %0s", 'Id', 'Name', 'RAM', 'VCPUs', 'Disk')
86
85
  flavors_numbered.each do |id, flavor|
87
86
  print sprintf("%0s %-15s %-10s %-10s %0s\n",
88
- "#{id}.", flavor[:name].split('.')[1], flavor[:ram], flavor[:vcpus], flavor[:disk])
87
+ "#{id}.", flavor.name.split('.')[1], flavor.ram, flavor.vcpus, flavor.disk)
89
88
  end
90
89
 
91
90
  flavor_name = item_chooser(flavors_numbered, 'flavor')
92
91
  print "Flavor Name: #{flavor_name.split('.')[1]}\n"
93
- comp_flvs.get_flavor(flavor_name)
92
+ p comp_flvs.methods
93
+ comp_flvs.get_flavor_by_name(flavor_name)
94
94
  end
95
95
 
96
96
  def self.keypair(comp_keys)
@@ -147,7 +147,7 @@ Should we create a new keypair named #{keypair_name}? (Y/N): "
147
147
  item_name = nil
148
148
  print "Which #{item} should we use for this instance?: "
149
149
 
150
- until items_numbered.values.collect{|i| i[:name]}.include?(item_name)
150
+ until items_numbered.values.collect{|i| i.name}.include?(item_name)
151
151
  item_name = gets.chomp
152
152
 
153
153
  if item_name =~ /^[0-9]*$/
@@ -156,10 +156,10 @@ Should we create a new keypair named #{keypair_name}? (Y/N): "
156
156
  item_name = gets.chomp
157
157
  end
158
158
 
159
- item_name = items_numbered[item_name.to_i][:name]
159
+ item_name = items_numbered[item_name.to_i].name
160
160
  end
161
161
 
162
- item_check = items_numbered.values.collect{|i| i[:name]}.include?(item_name)
162
+ item_check = items_numbered.values.collect{|i| i.name}.include?(item_name)
163
163
  print "#{item_name} is not a valid item. Please enter an option from above: " if item_check == false
164
164
  end
165
165
  item_name
@@ -1,3 +1,3 @@
1
1
  module DanarchySys
2
- VERSION = '0.4.1'
2
+ VERSION = '0.4.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danarchy_sys
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan James
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-17 00:00:00.000000000 Z
11
+ date: 2018-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-openstack