knife-cloudstack-fog 0.5.1 → 0.5.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: 05fe65a30aea4229b1b5f4447cd177deb529c59a
4
- data.tar.gz: 03471506357fec26e43618d1b2f3d77248734617
3
+ metadata.gz: cabd0497918fc2d74a07bf227823c06843871e11
4
+ data.tar.gz: 040fd195030f8066160240c34b4dcaa123ff1184
5
5
  SHA512:
6
- metadata.gz: d064b3b0476ee7c5549aee573c7d0bf561f60fe0ec26d04493744cee70b264eddb46d8ae22ed7af8d1339c79663ff14ad567b8543af93d8e06a36eebfeb25350
7
- data.tar.gz: 4081f2dd006525c54276b8d51f3693891652772888529359902d60fda5f9fe9c08b43fc84c6ced1fb6d697529cc436e0afa5af39ed5dc5069ae2b0e31c3714b8
6
+ metadata.gz: 5ba61637614a9af0a1a4f707a0d6345117924daf03bd5ca31e92099db48cd0a95604785bbedb2089fcffaeb84787c04e0d8ff8aae6b3b84c49052c859f72aaf6
7
+ data.tar.gz: ec4edf39407225b490845590148436e51c293490b928f6c6ed94f3d38780f63d604d69a70b00531f8111822fa7cc3e69982019c240987511a80bfbdcb9e2b4f1
@@ -78,8 +78,8 @@ class Chef
78
78
  template['hypervisor'] = ' ' if template['hypervisor'].nil?
79
79
  template_list << template['hypervisor']
80
80
 
81
- template_size = template['size']
82
- template_size = (template_size/1024/1024/1024)
81
+ template_size = template['size'].to_i
82
+ template_size = template_size / 1024 / 1024 / 1024
83
83
  template_list << template_size.to_s
84
84
 
85
85
  template_list << template['zonename']
@@ -0,0 +1,53 @@
1
+ # Author:: Kazuhiro Suzuki (<ksauzzmsg@gmail.com>)
2
+ # Copyright:: Copyright (c) 2014 Kazuhiro Suzuki
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+
19
+ require 'chef/knife/cloudstack_base'
20
+
21
+ class Chef
22
+ class Knife
23
+ class CloudstackVolumeDelete < Knife
24
+
25
+ include Knife::CloudstackBase
26
+ banner "knife cloudstack volume delete VOLUME_ID"
27
+
28
+ def run
29
+
30
+ if @name_args.nil? || @name_args.empty?
31
+ puts "#{ui.color("Please provide an Volume ID.", :red)}"
32
+ end
33
+
34
+ @name_args.each do |volume_id|
35
+ volume = connection.list_volumes('id' => volume_id)['listvolumesresponse']['volume'].first
36
+ volume_id = volume['id'].to_s
37
+ volume_name = volume['name'].to_s
38
+ volume_size = (volume['size']/1024/1024/1024).to_s
39
+ volume_type = volume['type']
40
+
41
+ puts "#{ui.color("Id", :red)}: #{volume_id}"
42
+ puts "#{ui.color("Name", :red)}: #{volume_name}"
43
+ puts "#{ui.color("Size (in GB)", :red)}: #{volume_size}"
44
+ puts "#{ui.color("Type", :red)}: #{volume_type}"
45
+ puts "\n"
46
+ confirm("#{ui.color("Do you really want to delete this volume", :red)}")
47
+ connection.delete_volume('id' => volume_id)
48
+ ui.warn("Deleted volume #{volume_name}")
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
1
+ # Author:: Kazuhiro Suzuki (<ksauzzmsg@gmail.com>)
2
+ # Copyright:: Copyright (c) 2014 Kazuhiro Suzuki
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+
19
+ require 'chef/knife/cloudstack_base'
20
+
21
+ class Chef
22
+ class Knife
23
+ class CloudstackVolumeDetach < Knife
24
+
25
+ include Knife::CloudstackBase
26
+ banner "knife cloudstack volume detach VOLUME_ID"
27
+
28
+ def run
29
+
30
+ if @name_args.nil? || @name_args.empty?
31
+ puts "#{ui.color("Please provide an Volume ID.", :red)}"
32
+ end
33
+
34
+ @name_args.each do |volume_id|
35
+ volume = connection.list_volumes('id' => volume_id)['listvolumesresponse']['volume'].first
36
+ volume_id = volume['id'].to_s
37
+ volume_name = volume['name'].to_s
38
+ volume_size = (volume['size']/1024/1024/1024).to_s
39
+ volume_type = volume['type']
40
+
41
+ puts "#{ui.color("Id", :red)}: #{volume_id}"
42
+ puts "#{ui.color("Name", :red)}: #{volume_name}"
43
+ puts "#{ui.color("Size (in GB)", :red)}: #{volume_size}"
44
+ puts "#{ui.color("Type", :red)}: #{volume_type}"
45
+ puts "\n"
46
+ confirm("#{ui.color("Do you really want to delete this volume", :red)}")
47
+ connection.detach_volume('id' => volume_id)
48
+ ui.warn("Detached volume #{volume_name}")
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Cloudstack
3
- VERSION = "0.5.1"
3
+ VERSION = "0.5.2"
4
4
  MAJOR, MINOR, TINY = VERSION.split('.')
5
5
  end
6
- end
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-cloudstack-fog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chirag Jog (chiragjog)
@@ -12,48 +12,48 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-12-30 00:00:00.000000000 Z
15
+ date: 2014-05-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: fog
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - '>='
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.10.0
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - '>='
28
+ - - ">="
29
29
  - !ruby/object:Gem::Version
30
30
  version: 1.10.0
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: chef
33
33
  requirement: !ruby/object:Gem::Requirement
34
34
  requirements:
35
- - - '>='
35
+ - - ">="
36
36
  - !ruby/object:Gem::Version
37
37
  version: 11.2.0
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - '>='
42
+ - - ">="
43
43
  - !ruby/object:Gem::Version
44
44
  version: 11.2.0
45
45
  - !ruby/object:Gem::Dependency
46
46
  name: rake
47
47
  requirement: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - '>='
49
+ - - ">="
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  type: :runtime
53
53
  prerelease: false
54
54
  version_requirements: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - '>='
56
+ - - ">="
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  description: Support for the Chef Knife command, leveraging FOG, for the Apache CloudStack
@@ -70,6 +70,8 @@ extra_rdoc_files:
70
70
  - README.rdoc
71
71
  - LICENSE
72
72
  files:
73
+ - LICENSE
74
+ - README.rdoc
73
75
  - lib/chef/knife/cloudstack_base.rb
74
76
  - lib/chef/knife/cloudstack_diskoffering_list.rb
75
77
  - lib/chef/knife/cloudstack_keypair_create.rb
@@ -91,11 +93,11 @@ files:
91
93
  - lib/chef/knife/cloudstack_server_stop.rb
92
94
  - lib/chef/knife/cloudstack_serviceoffering_list.rb
93
95
  - lib/chef/knife/cloudstack_template_list.rb
96
+ - lib/chef/knife/cloudstack_volume_delete.rb
97
+ - lib/chef/knife/cloudstack_volume_detach.rb
94
98
  - lib/chef/knife/cloudstack_volumes_list.rb
95
99
  - lib/chef/knife/cloudstack_zone_list.rb
96
100
  - lib/knife-cloudstack-fog/version.rb
97
- - README.rdoc
98
- - LICENSE
99
101
  homepage: https://github.com/fifthecho/knife-cloudstack-fog
100
102
  licenses:
101
103
  - Apache 2.0
@@ -106,17 +108,17 @@ require_paths:
106
108
  - lib
107
109
  required_ruby_version: !ruby/object:Gem::Requirement
108
110
  requirements:
109
- - - '>='
111
+ - - ">="
110
112
  - !ruby/object:Gem::Version
111
113
  version: '0'
112
114
  required_rubygems_version: !ruby/object:Gem::Requirement
113
115
  requirements:
114
- - - '>='
116
+ - - ">="
115
117
  - !ruby/object:Gem::Version
116
118
  version: '0'
117
119
  requirements: []
118
120
  rubyforge_project:
119
- rubygems_version: 2.0.14
121
+ rubygems_version: 2.2.2
120
122
  signing_key:
121
123
  specification_version: 4
122
124
  summary: Cloudstack Compute Support for Chef's Knife Command