knife-xapi 0.5.2 → 0.5.3

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.
@@ -1,3 +1,3 @@
1
1
  module KnifeXenserver
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-xapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -127,7 +127,6 @@ files:
127
127
  - lib/chef/knife/xapi_vdi_delete.rb
128
128
  - lib/chef/knife/xapi_vdi_detach.rb
129
129
  - lib/chef/knife/xapi_vdi_list.rb
130
- - lib/chef/knife/xapi_vif_list.rb
131
130
  - lib/chef/knife/xapi_vlan_list.rb
132
131
  - lib/chef/knife/xapi_vmselect.rb
133
132
  - lib/knife-xapi/version.rb
@@ -1,67 +0,0 @@
1
- #
2
- # Author:: Jesse Nelson (<spheromak@gmail.com>)
3
- #
4
- # Copyright:: Copyright (c) 2012 Jesse Nelson
5
- #
6
- # License:: Apache License, Version 2.0
7
- #
8
- # Licensed under the Apache License, Version 2.0 (the "License");
9
- # you may not use this file except in compliance with the License.
10
- # You may obtain a copy of the License at
11
- #
12
- # http://www.apache.org/licenses/LICENSE-2.0
13
- #
14
- # Unless required by applicable law or agreed to in writing, software
15
- # distributed under the License is distributed on an "AS IS" BASIS,
16
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- # See the License for the specific language governing permissions and
18
- # limitations under the License.
19
- #
20
-
21
-
22
- require 'chef/knife/xapi_base'
23
-
24
- class Chef
25
- class Knife
26
- class XapiVifList < Knife
27
- include Chef::Knife::XapiBase
28
-
29
- banner "knife xapi vif list"
30
-
31
- option :vif_name,
32
- :short => "-N",
33
- :long => "--vif-name",
34
- :default => false,
35
- :description => "Indicates this is a vif name not a guest name"
36
-
37
- def run
38
- # Get all vifs known to the system
39
- name = @name_args[0]
40
-
41
- # if we were passed a guest name find its vdi's
42
- # otherwise do it for everything
43
- vifs = Array.new
44
- if name.nil? or name.empty?
45
- vifs = xapi.VIF.getAllRecords
46
-
47
- elsif config[:vif_name]
48
- vdis = xapi.VIF.get_by_name_label( name )
49
-
50
- else
51
- ref = xapi.VM.get_by_name_label( name )
52
- vm = xapi.VM.get_record( ref.first )
53
-
54
- vm["VIFs"].each do |vif|
55
- vdis << xapi.VIF.get_record( vif )["VIF"]
56
- end
57
- end
58
-
59
- vifs.each do |vif|
60
- print_vif_info vif
61
- end
62
-
63
- end
64
- end
65
- end
66
- end
67
-