opennebula-cli 5.0.0 → 5.0.2

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: 0d9b56960590291cd32e8624224784f6d457b0dd
4
- data.tar.gz: 7da70ea462ad1446c4ed9916b02f8827d0a4bb90
3
+ metadata.gz: 10038339d922cdf1ab6992aa381ed432f3965149
4
+ data.tar.gz: 11cc0ef4f6ddb062f2ed6641a0fdd7babc6d697a
5
5
  SHA512:
6
- metadata.gz: 159f97db54fa505c0b8e69a14293f5746d8769425bcd8e80d706865c8b008f2c029975854b951117a04483f3e546736f48e355a162f6d86075d73a211c42265a
7
- data.tar.gz: 1eb956cfd583f699cf2e5ee61c0e8ec557a9c6244758a965bbeb251548a804219d6736be73543003fb9193a098bb932f7541e07620606a30e32d653c754c27eb
6
+ metadata.gz: 058178f751626c5ef3d2839be154e26539cef81bb368076605eefbd0626712bbdb26fd22f3f33d52d159b5e71d632961ec5b9f9ddd28c8a5548a498a63b980fe
7
+ data.tar.gz: 859c40a5741d92f33108dc8b892a38761095b96c60b42f68aa380c0a56b902e99694bc3fdd4dce09cb351ee9e877b7cb3dfc305c6ddc6b2d42f7a7c51ec9260e
data/bin/oneuser CHANGED
@@ -516,4 +516,18 @@ cmd=CommandParser::CmdParser.new(ARGV) do
516
516
 
517
517
  0
518
518
  end
519
+
520
+ passwdsearch_desc = <<-EOT.unindent
521
+ Searches for users with a specific auth driver that has the given
522
+ string in their password field
523
+ EOT
524
+
525
+ command :passwdsearch, passwdsearch_desc, :driver, :password,
526
+ :options=>[CLIHelper::CSV_OPT, OpenNebulaHelper::XML] do
527
+
528
+ options[:list] = ["ID", "NAME", "AUTH", "PASSWORD"]
529
+ options[:filter] = ["AUTH=#{args[0]}", "PASSWORD=#{args[1]}"]
530
+
531
+ helper.list_pool(options)
532
+ end
519
533
  end
data/bin/onevrouter CHANGED
@@ -119,7 +119,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
119
119
  :options=>instantiate_options+OpenNebulaHelper::TEMPLATE_OPTIONS do
120
120
  exit_code=0
121
121
 
122
- if args[1] && OpenNebulaHelper.create_template_options_used?(options)
122
+ if args[2] && OpenNebulaHelper.create_template_options_used?(options)
123
123
  STDERR.puts "You cannot use both template file and template"<<
124
124
  " creation options."
125
125
  next -1
@@ -45,13 +45,6 @@ private
45
45
  end
46
46
  end
47
47
 
48
- EXTERNAL_IP_ATTRS = [
49
- 'GUEST_IP',
50
- 'AWS_IP_ADDRESS',
51
- 'AZ_IPADDRESS',
52
- 'SL_PRIMARYIPADDRESS'
53
- ];
54
-
55
48
 
56
49
  class OneVMHelper < OpenNebulaHelper::OneHelper
57
50
  MULTIPLE={
@@ -171,6 +164,10 @@ class OneVMHelper < OpenNebulaHelper::OneHelper
171
164
  vm_nics = [vm["TEMPLATE"]['NIC']].flatten
172
165
  end
173
166
 
167
+ if !vm["TEMPLATE"]["PCI"].nil?
168
+ vm_nics = [vm_nics, vm["TEMPLATE"]['PCI']].flatten
169
+ end
170
+
174
171
  vm_nics.each do |nic|
175
172
  ["IP", "IP6_GLOBAL", "IP6_ULA",
176
173
  "VROUTER_IP", "VROUTER_IP6_GLOBAL", "VROUTER_IP6_ULA"].each do |attr|
@@ -475,6 +472,8 @@ in the frontend machine.
475
472
 
476
473
  cluster = nil
477
474
 
475
+ vm_hash = vm.to_hash
476
+
478
477
  if %w{ACTIVE SUSPENDED POWEROFF}.include? vm.state_str
479
478
  cluster_id = vm['/VM/HISTORY_RECORDS/HISTORY[last()]/CID']
480
479
  else
@@ -522,12 +521,12 @@ in the frontend machine.
522
521
 
523
522
  CLIHelper.print_header(str_h1 % "VIRTUAL MACHINE MONITORING",false)
524
523
 
525
- vm_monitoring = vm.to_hash['VM']['MONITORING']
524
+ vm_monitoring = vm_hash['VM']['MONITORING']
526
525
 
527
526
  # Find out if it is a hybrid VM to avoid showing local IPs
528
527
  isHybrid=false
529
528
  vm_monitoring.each{|key, value|
530
- if EXTERNAL_IP_ATTRS.include? key
529
+ if VirtualMachine::EXTERNAL_IP_ATTRS.include? key
531
530
  isHybrid=true
532
531
  end
533
532
  }
@@ -576,11 +575,11 @@ in the frontend machine.
576
575
  vm_disks = []
577
576
 
578
577
  if vm.has_elements?("/VM/TEMPLATE/DISK")
579
- vm_disks = [vm.to_hash['VM']['TEMPLATE']['DISK']].flatten
578
+ vm_disks = [vm_hash['VM']['TEMPLATE']['DISK']].flatten
580
579
  end
581
580
 
582
581
  if vm.has_elements?("/VM/TEMPLATE/CONTEXT")
583
- context_disk = vm.to_hash['VM']['TEMPLATE']['CONTEXT']
582
+ context_disk = vm_hash['VM']['TEMPLATE']['CONTEXT']
584
583
 
585
584
  context_disk["IMAGE"] = "CONTEXT"
586
585
  context_disk["DATASTORE"] = "-"
@@ -689,16 +688,21 @@ in the frontend machine.
689
688
 
690
689
  sg_nics = []
691
690
 
692
- if (vm.has_elements?("/VM/TEMPLATE/NIC/SECURITY_GROUPS"))
693
- sg_nics = [vm.to_hash['VM']['TEMPLATE']['NIC']].flatten
691
+ if (vm.has_elements?("/VM/TEMPLATE/NIC/SECURITY_GROUPS") ||
692
+ vm.has_elements?("/VM/TEMPLATE/PCI[NIC_ID>-1]/SECURITY_GROUPS"))
694
693
 
695
- sg_nics.each do |nic|
696
- sg = nic["SECURITY_GROUPS"]
694
+ sg_nics = [vm_hash['VM']['TEMPLATE']['NIC']]
697
695
 
698
- if sg.nil?
699
- next
696
+ sg_pcis = [vm_hash['VM']['TEMPLATE']['PCI']].flatten.compact
697
+
698
+ sg_pcis.each do |pci|
699
+ if !pci['NIC_ID'].nil?
700
+ sg_nics << pci
700
701
  end
701
702
  end
703
+
704
+ sg_nics.flatten!
705
+ sg_nics.compact!
702
706
  end
703
707
 
704
708
  # This variable holds the extra IP's got from monitoring. Right
@@ -717,7 +721,9 @@ in the frontend machine.
717
721
 
718
722
  extra_ips.uniq!
719
723
 
720
- if vm.has_elements?("/VM/TEMPLATE/NIC") || !extra_ips.empty?
724
+ if vm.has_elements?("/VM/TEMPLATE/NIC") ||
725
+ vm.has_elements?("/VM/TEMPLATE/PCI[NIC_ID>-1]") || !extra_ips.empty?
726
+
721
727
  puts
722
728
  CLIHelper.print_header(str_h1 % "VM NICS",false)
723
729
 
@@ -729,7 +735,19 @@ in the frontend machine.
729
735
  shown_ips = []
730
736
 
731
737
  array_id = 0
732
- vm_nics = [vm.to_hash['VM']['TEMPLATE']['NIC']].flatten.compact
738
+ vm_nics = [vm_hash['VM']['TEMPLATE']['NIC']]
739
+
740
+ vm_pcis = [vm_hash['VM']['TEMPLATE']['PCI']].flatten.compact
741
+
742
+ vm_pcis.each do |pci|
743
+ if !pci['NIC_ID'].nil?
744
+ vm_nics << pci
745
+ end
746
+ end
747
+
748
+ vm_nics.flatten!
749
+ vm_nics.compact!
750
+
733
751
  vm_nics.each {|nic|
734
752
 
735
753
  next if nic.has_key?("CLI_DONE")
@@ -816,6 +834,14 @@ in the frontend machine.
816
834
  end
817
835
  end
818
836
 
837
+ column :PCI_ID, "", :left, :size=>8 do |d|
838
+ if d["DOUBLE_ENTRY"]
839
+ ""
840
+ else
841
+ d["PCI_ID"]
842
+ end
843
+ end
844
+
819
845
  end.show(vm_nics,{})
820
846
 
821
847
  while vm.has_elements?("/VM/TEMPLATE/NIC")
@@ -898,7 +924,7 @@ in the frontend machine.
898
924
  d["RANGE"]
899
925
  end
900
926
 
901
- end.show([vm.to_hash['VM']['TEMPLATE']['SECURITY_GROUP_RULE']].flatten, {})
927
+ end.show([vm_hash['VM']['TEMPLATE']['SECURITY_GROUP_RULE']].flatten, {})
902
928
 
903
929
  while vm.has_elements?("/VM/TEMPLATE/SECURITY_GROUP_RULE")
904
930
  vm.delete_element("/VM/TEMPLATE/SECURITY_GROUP_RULE")
@@ -927,7 +953,7 @@ in the frontend machine.
927
953
  d["HYPERVISOR_ID"] if !d.nil?
928
954
  end
929
955
 
930
- end.show([vm.to_hash['VM']['TEMPLATE']['SNAPSHOT']].flatten, {})
956
+ end.show([vm_hash['VM']['TEMPLATE']['SNAPSHOT']].flatten, {})
931
957
 
932
958
  vm.delete_element("/VM/TEMPLATE/SNAPSHOT")
933
959
  end
@@ -964,7 +990,7 @@ in the frontend machine.
964
990
  column :"MESSAGE", "", :left, :donottruncate, :size=>35 do |d|
965
991
  d["MESSAGE"] if !d.nil?
966
992
  end
967
- end.show([vm.to_hash['VM']['USER_TEMPLATE']['SCHED_ACTION']].flatten, {})
993
+ end.show([vm_hash['VM']['USER_TEMPLATE']['SCHED_ACTION']].flatten, {})
968
994
  end
969
995
 
970
996
  if vm.has_elements?("/VM/USER_TEMPLATE")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opennebula-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenNebula
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-15 00:00:00.000000000 Z
11
+ date: 2016-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opennebula
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0
19
+ version: 5.0.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0
26
+ version: 5.0.2
27
27
  description: Commands used to talk to OpenNebula
28
28
  email: contact@opennebula.org
29
29
  executables:
@@ -40,7 +40,6 @@ executables:
40
40
  - onesecgroup
41
41
  - oneshowback
42
42
  - onetemplate
43
- - oneuser
44
43
  - onevdc
45
44
  - onevnet
46
45
  - onezone
@@ -48,6 +47,7 @@ executables:
48
47
  - onevm
49
48
  - oneacct
50
49
  - onevcenter
50
+ - oneuser
51
51
  - onevrouter
52
52
  extensions: []
53
53
  extra_rdoc_files: []