danarchy_sys 0.2.16 → 0.2.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.txt +1 -1
- data/lib/danarchy_sys/cli/instance_manager.rb +4 -4
- data/lib/danarchy_sys/cli/instance_manager/instance_status.rb +3 -3
- data/lib/danarchy_sys/cli/instance_manager/prompts_create_instance.rb +6 -6
- data/lib/danarchy_sys/cli/keypair_manager.rb +2 -2
- data/lib/danarchy_sys/cli/keypair_manager/keypair_status.rb +1 -1
- data/lib/danarchy_sys/openstack/compute.rb +6 -6
- data/lib/danarchy_sys/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dd08ba1e4fcce5f446e2198ca93828f8f9271d9
|
4
|
+
data.tar.gz: 00c68532f44cbec2e9891bf47f820419ef57e287
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 395284512dd1b5b7447cb7e3f9dafac22c5a88283d36c224f5d812389a4863628c46d3ed52f3c88e757d102dec638b59a3530e397ee6f5461ac617663dbaeec5
|
7
|
+
data.tar.gz: 8c8f71e0205ed5af717fc2fe95c9f1e14bc791687cbbbf97d1dfef592ba2b83cdbb60c15cd633c0dcb7c677eca98d28dac30d55e9aba93ee2acae2a3704117ae
|
data/README.txt
CHANGED
@@ -39,7 +39,7 @@ OpenStack -> os_dreamcompute
|
|
39
39
|
dAnarchy_sys main menu commands:
|
40
40
|
Enter 'help' to view available commands or 'exit' to leave.
|
41
41
|
1. instance: Instance Manager
|
42
|
-
2. keypair: Keypair Manager
|
42
|
+
2. keypair: Keypair Manager
|
43
43
|
3. help: Outputs commands for current the menu level
|
44
44
|
4. exit: Exit dAnarchy_sys
|
45
45
|
command ~: instance
|
@@ -3,7 +3,7 @@ require_relative 'instance_manager/instance_status'
|
|
3
3
|
|
4
4
|
class InstanceManager
|
5
5
|
def self.manager(os_compute)
|
6
|
-
comp_inst = os_compute.
|
6
|
+
comp_inst = os_compute.instances
|
7
7
|
puts 'Instance Manager: enter \'help\' to view available commands or \'main\' for the main menu.'
|
8
8
|
menu = Menus.numbered_menu('instance')
|
9
9
|
instance = false
|
@@ -60,7 +60,7 @@ class InstanceManager
|
|
60
60
|
end
|
61
61
|
|
62
62
|
until status != instance.state
|
63
|
-
instance = os_compute.
|
63
|
+
instance = os_compute.instances.get_instance(instance.name)
|
64
64
|
sleep(3)
|
65
65
|
print ' .'
|
66
66
|
end
|
@@ -68,7 +68,7 @@ class InstanceManager
|
|
68
68
|
printf("\n%#{instance.name.size}s %0s %0s\n", instance.name, ' => ', instance.state)
|
69
69
|
elsif cmd == 'connect'
|
70
70
|
if instance.state == 'ACTIVE'
|
71
|
-
os_compute.
|
71
|
+
os_compute.ssh(instance.name.to_s)
|
72
72
|
else
|
73
73
|
puts "Unable to connect: #{instance.name} is not running!"
|
74
74
|
end
|
@@ -82,7 +82,7 @@ class InstanceManager
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def self.chooser(os_compute)
|
85
|
-
comp_inst = os_compute.
|
85
|
+
comp_inst = os_compute.instances
|
86
86
|
instances = comp_inst.all_instances
|
87
87
|
instances_numhash = Helpers.objects_to_numhash(instances)
|
88
88
|
instance_name = 'nil'
|
@@ -27,9 +27,9 @@ class InstanceStatus
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def self.single_instance(os_compute, instance)
|
30
|
-
comp_inst = os_compute.
|
31
|
-
comp_imgs = os_compute.
|
32
|
-
comp_flvs = os_compute.
|
30
|
+
comp_inst = os_compute.instances
|
31
|
+
comp_imgs = os_compute.images
|
32
|
+
comp_flvs = os_compute.flavors
|
33
33
|
|
34
34
|
image = comp_imgs.get_image_by_id(instance.image['id'])
|
35
35
|
flavor = comp_flvs.get_flavor_by_id(instance.flavor['id'])
|
@@ -2,10 +2,10 @@
|
|
2
2
|
# CLI Prompt to create a new instance
|
3
3
|
class PromptsCreateInstance
|
4
4
|
def self.create_instance(os_compute, instance_name)
|
5
|
-
comp_inst = os_compute.
|
6
|
-
comp_imgs = os_compute.
|
7
|
-
comp_flvs = os_compute.
|
8
|
-
comp_keys = os_compute.
|
5
|
+
comp_inst = os_compute.instances
|
6
|
+
comp_imgs = os_compute.images
|
7
|
+
comp_flvs = os_compute.flavors
|
8
|
+
comp_keys = os_compute.keypairs
|
9
9
|
|
10
10
|
# Prompt for and check that instance_name is unused
|
11
11
|
if instance_name == 'nil'
|
@@ -79,12 +79,12 @@ class PromptsCreateInstance
|
|
79
79
|
image_name = gets.chomp
|
80
80
|
|
81
81
|
if image_name =~ /^[0-9]*$/
|
82
|
-
until images_numbered.keys.include?(image_name)
|
82
|
+
until images_numbered.keys.include?(image_name.to_i)
|
83
83
|
print "#{image_name} is not a valid Id. Enter an Id from above: "
|
84
84
|
image_name = gets.chomp
|
85
85
|
end
|
86
86
|
|
87
|
-
image_name = images_numbered[image_name.
|
87
|
+
image_name = images_numbered[image_name.to_i]
|
88
88
|
end
|
89
89
|
|
90
90
|
image_check = images_numbered.values.include?(image_name)
|
@@ -3,7 +3,7 @@ require_relative './keypair_manager/keypair_status'
|
|
3
3
|
|
4
4
|
class KeypairManager
|
5
5
|
def self.manager(os_compute)
|
6
|
-
comp_kp = os_compute.
|
6
|
+
comp_kp = os_compute.keypairs
|
7
7
|
puts 'Keypair Manager: enter \'help\' to view available commands or \'main\' for the main menu.'
|
8
8
|
menu = Menus.numbered_menu('keypair')
|
9
9
|
keypair = false
|
@@ -63,7 +63,7 @@ class KeypairManager
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def self.chooser(os_compute)
|
66
|
-
comp_kp = os_compute.
|
66
|
+
comp_kp = os_compute.keypairs
|
67
67
|
keypairs = comp_kp.list_keypairs
|
68
68
|
keypair_numhash = Helpers.array_to_numhash(keypairs)
|
69
69
|
keypair_name = 'nil'
|
@@ -13,24 +13,24 @@ module DanarchySys
|
|
13
13
|
@compute = Fog::Compute::OpenStack.new(connection)
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
16
|
+
def instances
|
17
17
|
ComputeInstances.new(@compute, @settings)
|
18
18
|
end
|
19
19
|
|
20
|
-
def
|
20
|
+
def keypairs
|
21
21
|
ComputeKeypairs.new(@compute, @settings)
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
24
|
+
def images
|
25
25
|
ComputeImages.new(@compute)
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
28
|
+
def flavors
|
29
29
|
ComputeFlavors.new(@compute)
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
33
|
-
(comp_inst, comp_kp, comp_img) =
|
32
|
+
def ssh(instance_name)
|
33
|
+
(comp_inst, comp_kp, comp_img) = instances, keypairs, images
|
34
34
|
instance = comp_inst.get_instance(instance_name)
|
35
35
|
keypair_name = instance.key_name
|
36
36
|
pemfile = comp_kp.pemfile_path(keypair_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.2.
|
4
|
+
version: 0.2.17
|
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-
|
11
|
+
date: 2017-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-openstack
|