danarchy_sys 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91467380d7fc7465187c4929c8421828cb7d1343
|
4
|
+
data.tar.gz: c97f5d4a0b6ad94e05a2e7758b8f525f8184d2ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
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
|
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.
|
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
|
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.
|
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
|
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]
|
159
|
+
item_name = items_numbered[item_name.to_i].name
|
160
160
|
end
|
161
161
|
|
162
|
-
item_check = items_numbered.values.collect{|i| i
|
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
|
data/lib/danarchy_sys/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2018-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-openstack
|