vagrant-openstack-provider 0.3.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MzI3NjM4NTQwZWQwODg5OGRiMjFhNDU5MGViNmY5ZjVlMjAzOTc0NA==
5
- data.tar.gz: !binary |-
6
- N2UwODBjOGE5ZTgwOGEwYjQ4ZjE3YmMwZjA4ZWVlOGUyYmYyMTI4Zg==
2
+ SHA1:
3
+ metadata.gz: 646c0f2d9af2adc263a14c00ceeb12e95e1b4959
4
+ data.tar.gz: 830a3a035677fdecb4d34a8509d2f2277aefe526
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MGQ4NzZmYTg3YjNhYzUyMWJhZjQ2YTE3MjA2OTEyNGRhY2FkMmQ5MjgwZjQy
10
- NWJlMDk0NGViOTU3MDA0ZDEwMmY3YzY1ZmU0OWQ4NjZiZWRhNzExZmIzNGU5
11
- ZGU4OWE0NTFkYWY2MTM2NTcwZWU0MjMzYzA2ZTUxNmM4NTI4OWY=
12
- data.tar.gz: !binary |-
13
- NDY3YmZmOTA2OWJkMGRlOTE0ODdkYmEwNmM1YzNlZmE5ODlkMjViZWNjMjUx
14
- OWY1NTgxZWQwMDBjMmQ1MDllMWE4MGU1MzM0YjZhNTVjM2ZiMDE1ZmE4MzJk
15
- ZGE2Y2NhNjFmZjE5NmU1YTBlMWYxYjUzNWM2ZDIzMGQ2MjIyN2Q=
6
+ metadata.gz: 37f7b1bd1f4bfefe872c1c345bc0f766691d928feb962f410d60cec828dd2d287c6950802977c69ac88d498398e77916eec9913949e4f4cc14d24a15a92a0473
7
+ data.tar.gz: 3b806a165b43362c97a78e2fdbf9d5fd40b64bf6c7159ce7d08dfb00bafe40c0580247b1258e18b01771c8ba16f4ba3ea242db43a22f66358cdc017a763c427d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.3.2 (September 1, 2014)
2
+
3
+ BUG FIXES:
4
+
5
+ - The provider fails to load colorize gem [#76](https://github.com/ggiamarchi/vagrant-openstack-provider/issues/76)
6
+ - Sub-command arguments management have change in vagrant 1.5 [#77](https://github.com/ggiamarchi/vagrant-openstack-provider/issues/77)
7
+
1
8
  # 0.3.0 (August 29, 2014)
2
9
 
3
10
  FEATURES:
data/Gemfile CHANGED
@@ -19,3 +19,7 @@ group :development do
19
19
  gem 'coveralls', require: false
20
20
  gem 'debugger'
21
21
  end
22
+
23
+ group :plugins do
24
+ gem "vagrant-openstack-provider", path: "."
25
+ end
@@ -13,6 +13,40 @@ module VagrantPlugins
13
13
  end
14
14
  end
15
15
 
16
+ class Flavor < Item
17
+ #
18
+ # THe number of vCPU
19
+ #
20
+ attr_accessor :vcpus
21
+
22
+ #
23
+ # The amount of RAM in Megaoctet
24
+ #
25
+ attr_accessor :ram
26
+
27
+ #
28
+ # The size of root disk in Gigaoctet
29
+ #
30
+ attr_accessor :disk
31
+
32
+ def initialize(id, name, vcpus, ram, disk)
33
+ @vcpus = vcpus
34
+ @ram = ram
35
+ @disk = disk
36
+ super(id, name)
37
+ end
38
+
39
+ def ==(other)
40
+ other.class == self.class && other.state == state
41
+ end
42
+
43
+ protected
44
+
45
+ def state
46
+ [@id, @name, @vcpus, @ram, @disk]
47
+ end
48
+ end
49
+
16
50
  class FloatingIP
17
51
  attr_accessor :ip, :pool, :instance_id
18
52
  def initialize(ip, pool, instance_id)
@@ -18,8 +18,10 @@ module VagrantPlugins
18
18
  end
19
19
 
20
20
  def get_all_flavors(env)
21
- flavors_json = get(env, "#{@session.endpoints[:compute]}/flavors")
22
- JSON.parse(flavors_json)['flavors'].map { |fl| Item.new(fl['id'], fl['name']) }
21
+ flavors_json = get(env, "#{@session.endpoints[:compute]}/flavors/detail")
22
+ JSON.parse(flavors_json)['flavors'].map do |fl|
23
+ Flavor.new(fl['id'], fl['name'], fl['vcpus'], fl['ram'], fl['disk'])
24
+ end
23
25
  end
24
26
 
25
27
  def get_all_floating_ips(env)
@@ -11,9 +11,14 @@ module VagrantPlugins
11
11
  I18n.t('vagrant_openstack.command.flavor_list_synopsis')
12
12
  end
13
13
  def cmd(name, argv, env)
14
- fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 1
14
+ fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0 || argv == ['--']
15
15
  flavors = env[:openstack_client].nova.get_all_flavors(env)
16
- display_item_list(env, flavors)
16
+
17
+ rows = []
18
+ flavors.each do |f|
19
+ rows << [f.id, f.name, f.vcpus, f.ram, f.disk]
20
+ end
21
+ display_table(env, ['Id', 'Name', 'vCPU', 'RAM (Mo)', 'Disk size (Go)'], rows)
17
22
  end
18
23
  end
19
24
  end
@@ -11,7 +11,7 @@ module VagrantPlugins
11
11
  I18n.t('vagrant_openstack.command.flaotingip_list_synopsis')
12
12
  end
13
13
  def cmd(name, argv, env)
14
- fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 1
14
+ fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0 || argv == ['--']
15
15
 
16
16
  floating_ip_pools = env[:openstack_client].nova.get_floating_ip_pools(env)
17
17
  floating_ips = env[:openstack_client].nova.get_floating_ips(env)
@@ -11,7 +11,7 @@ module VagrantPlugins
11
11
  I18n.t('vagrant_openstack.command.image_list_synopsis')
12
12
  end
13
13
  def cmd(name, argv, env)
14
- fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 1
14
+ fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0 || argv == ['--']
15
15
  images = env[:openstack_client].nova.get_all_images(env)
16
16
  display_item_list(env, images)
17
17
  end
@@ -11,7 +11,7 @@ module VagrantPlugins
11
11
  I18n.t('vagrant_openstack.command.network_list_synopsis')
12
12
  end
13
13
  def cmd(name, argv, env)
14
- fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 1
14
+ fail Errors::NoArgRequiredForCommand, cmd: name unless argv.size == 0 || argv == ['--']
15
15
  flavors = env[:openstack_client].neutron.get_private_networks(env)
16
16
  display_item_list(env, flavors)
17
17
  end
@@ -9,7 +9,7 @@ module VagrantPlugins
9
9
  items.each do |item|
10
10
  rows << [item.id, item.name]
11
11
  end
12
- display_table(env, %w('Id' 'Name'), rows)
12
+ display_table(env, %w(Id Name), rows)
13
13
  end
14
14
 
15
15
  def display_table(env, headers, rows)
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Openstack
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.2'
4
4
  end
5
5
  end
@@ -45,7 +45,7 @@ describe VagrantPlugins::Openstack::NovaClient do
45
45
  describe 'get_all_flavors' do
46
46
  context 'with token and project_id acquainted' do
47
47
  it 'returns all flavors' do
48
- stub_request(:get, 'http://nova/a1b2c3/flavors')
48
+ stub_request(:get, 'http://nova/a1b2c3/flavors/detail')
49
49
  .with(
50
50
  headers:
51
51
  {
@@ -54,15 +54,17 @@ describe VagrantPlugins::Openstack::NovaClient do
54
54
  })
55
55
  .to_return(
56
56
  status: 200,
57
- body: '{ "flavors": [ { "id": "f1", "name": "flavor1"}, { "id": "f2", "name": "flavor2"} ] }')
57
+ body: '{
58
+ "flavors": [
59
+ { "id": "f1", "name": "flavor1", "vcpus":"1", "ram": "1024", "disk": "10"},
60
+ { "id": "f2", "name": "flavor2", "vcpus":"2", "ram": "2048", "disk": "20"}
61
+ ]}')
58
62
 
59
63
  flavors = @nova_client.get_all_flavors(env)
60
64
 
61
65
  expect(flavors.length).to eq(2)
62
- expect(flavors[0].id).to eq('f1')
63
- expect(flavors[0].name).to eq('flavor1')
64
- expect(flavors[1].id).to eq('f2')
65
- expect(flavors[1].name).to eq('flavor2')
66
+ expect(flavors[0]).to eq(Flavor.new('f1', 'flavor1', '1', '1024', '10'))
67
+ expect(flavors[1]).to eq(Flavor.new('f2', 'flavor2', '2', '2048', '20'))
66
68
  end
67
69
  end
68
70
  end
@@ -11,6 +11,11 @@ Gem::Specification.new do |gem|
11
11
  gem.summary = 'Enables Vagrant to manage machines in Openstack Cloud.'
12
12
  gem.homepage = 'https://github.com/ggiamarchi/vagrant-openstack'
13
13
 
14
+ gem.add_dependency 'restclient', '0.10.0'
15
+ gem.add_dependency 'terminal-table', '1.4.5'
16
+ gem.add_dependency 'sshkey', '1.6.1'
17
+ gem.add_dependency 'colorize', '0.7.3'
18
+
14
19
  gem.add_development_dependency 'rake'
15
20
  gem.add_development_dependency 'rspec', '~> 2.13.0'
16
21
  gem.add_development_dependency 'aruba'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-openstack-provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Giamarchi
@@ -9,48 +9,104 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-29 00:00:00.000000000 Z
12
+ date: 2014-09-01 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: restclient
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '='
19
+ - !ruby/object:Gem::Version
20
+ version: 0.10.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '='
26
+ - !ruby/object:Gem::Version
27
+ version: 0.10.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: terminal-table
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '='
33
+ - !ruby/object:Gem::Version
34
+ version: 1.4.5
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '='
40
+ - !ruby/object:Gem::Version
41
+ version: 1.4.5
42
+ - !ruby/object:Gem::Dependency
43
+ name: sshkey
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '='
47
+ - !ruby/object:Gem::Version
48
+ version: 1.6.1
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '='
54
+ - !ruby/object:Gem::Version
55
+ version: 1.6.1
56
+ - !ruby/object:Gem::Dependency
57
+ name: colorize
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '='
61
+ - !ruby/object:Gem::Version
62
+ version: 0.7.3
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '='
68
+ - !ruby/object:Gem::Version
69
+ version: 0.7.3
14
70
  - !ruby/object:Gem::Dependency
15
71
  name: rake
16
72
  requirement: !ruby/object:Gem::Requirement
17
73
  requirements:
18
- - - ! '>='
74
+ - - ">="
19
75
  - !ruby/object:Gem::Version
20
76
  version: '0'
21
77
  type: :development
22
78
  prerelease: false
23
79
  version_requirements: !ruby/object:Gem::Requirement
24
80
  requirements:
25
- - - ! '>='
81
+ - - ">="
26
82
  - !ruby/object:Gem::Version
27
83
  version: '0'
28
84
  - !ruby/object:Gem::Dependency
29
85
  name: rspec
30
86
  requirement: !ruby/object:Gem::Requirement
31
87
  requirements:
32
- - - ~>
88
+ - - "~>"
33
89
  - !ruby/object:Gem::Version
34
90
  version: 2.13.0
35
91
  type: :development
36
92
  prerelease: false
37
93
  version_requirements: !ruby/object:Gem::Requirement
38
94
  requirements:
39
- - - ~>
95
+ - - "~>"
40
96
  - !ruby/object:Gem::Version
41
97
  version: 2.13.0
42
98
  - !ruby/object:Gem::Dependency
43
99
  name: aruba
44
100
  requirement: !ruby/object:Gem::Requirement
45
101
  requirements:
46
- - - ! '>='
102
+ - - ">="
47
103
  - !ruby/object:Gem::Version
48
104
  version: '0'
49
105
  type: :development
50
106
  prerelease: false
51
107
  version_requirements: !ruby/object:Gem::Requirement
52
108
  requirements:
53
- - - ! '>='
109
+ - - ">="
54
110
  - !ruby/object:Gem::Version
55
111
  version: '0'
56
112
  description: Enables Vagrant to manage machines in Openstack Cloud.
@@ -61,8 +117,8 @@ executables: []
61
117
  extensions: []
62
118
  extra_rdoc_files: []
63
119
  files:
64
- - .gitignore
65
- - .rubocop.yml
120
+ - ".gitignore"
121
+ - ".rubocop.yml"
66
122
  - Appraisals
67
123
  - CHANGELOG.md
68
124
  - Gemfile
@@ -137,12 +193,12 @@ require_paths:
137
193
  - lib
138
194
  required_ruby_version: !ruby/object:Gem::Requirement
139
195
  requirements:
140
- - - ! '>='
196
+ - - ">="
141
197
  - !ruby/object:Gem::Version
142
198
  version: '0'
143
199
  required_rubygems_version: !ruby/object:Gem::Requirement
144
200
  requirements:
145
- - - ! '>='
201
+ - - ">="
146
202
  - !ruby/object:Gem::Version
147
203
  version: '0'
148
204
  requirements: []