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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1dc8aee4f74e525822bf6f39af45612d8a7abd9
4
- data.tar.gz: 997a84b936ea0fd23e4134a2294612e654439075
3
+ metadata.gz: 5dd08ba1e4fcce5f446e2198ca93828f8f9271d9
4
+ data.tar.gz: 00c68532f44cbec2e9891bf47f820419ef57e287
5
5
  SHA512:
6
- metadata.gz: 8293f2a3dfb97a1a6b947a31ba11f6c6412d09ad3ce326a2f017d3233711567f03e6831240f420bdbcd0b360117f3de5ffbfd43fd70980d8ddeb7c4007e044c2
7
- data.tar.gz: f4e9bc35308b8bf9e0be45791e74c8032f5416fdc262df1c7c9349fcc8c60f539fd04667918e5b6517e5d41837fc5d5a4357b20cc84c6f43b6d6fec1d3454f4c
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 (Not yet implemented!)
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.compute_instances
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.compute_instances.get_instance(instance.name)
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.compute_ssh(instance.name.to_s)
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.compute_instances
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.compute_instances
31
- comp_imgs = os_compute.compute_images
32
- comp_flvs = os_compute.compute_flavors
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.compute_instances
6
- comp_imgs = os_compute.compute_images
7
- comp_flvs = os_compute.compute_flavors
8
- comp_keys = os_compute.compute_keypairs
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.to_s]
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.compute_keypairs
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.compute_keypairs
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'
@@ -1,7 +1,7 @@
1
1
 
2
2
  class KeypairStatus
3
3
  def self.all_keypairs(os_compute)
4
- keypairs = os_compute.compute_keypairs.all_keypairs
4
+ keypairs = os_compute.keypairs.all_keypairs
5
5
 
6
6
  keypairs.each do |keypair|
7
7
  single_keypair(keypair)
@@ -13,24 +13,24 @@ module DanarchySys
13
13
  @compute = Fog::Compute::OpenStack.new(connection)
14
14
  end
15
15
 
16
- def compute_instances
16
+ def instances
17
17
  ComputeInstances.new(@compute, @settings)
18
18
  end
19
19
 
20
- def compute_keypairs
20
+ def keypairs
21
21
  ComputeKeypairs.new(@compute, @settings)
22
22
  end
23
23
 
24
- def compute_images
24
+ def images
25
25
  ComputeImages.new(@compute)
26
26
  end
27
27
 
28
- def compute_flavors
28
+ def flavors
29
29
  ComputeFlavors.new(@compute)
30
30
  end
31
31
 
32
- def compute_ssh(instance_name)
33
- (comp_inst, comp_kp, comp_img) = compute_instances, compute_keypairs, compute_images
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)
@@ -1,3 +1,3 @@
1
1
  module DanarchySys
2
- VERSION = "0.2.16"
2
+ VERSION = "0.2.17"
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.2.16
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-07-20 00:00:00.000000000 Z
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-openstack